本文介绍了名称空间已经包含一个定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
CS0101:名称空间"NsDepartmentBranch"已经包含"IntDepartmentBranch1"行的定义
下面的代码
CS0101: The namespace ''NsDepartmentBranch'' already contains a definition for ''IntDepartmentBranch1'' line
the code below
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using DLL.HGTECH;
namespace NsDepartmentBranch
{
#region interface
interface IntDepartmentBranch122
{
int DEPARTMENT_BRANCH_ID
{
get;
set;
}
int DEPARTMENT_BRANCH_DEPARTMENT_ID
{
get;
set;
}
int DEPARTMENT_BRANCH_BRANCH_ID
{
get;
set;
}
Guid DEPARTMENT_BRANCH_CREATED_BY
{
get;
set;
}
Guid DEPARTMENT_BRANCH_MODIFIED_BY
{
get;
set;
}
DateTime DEPARTMENT_BRANCH_CREATED_DATE
{
get;
set;
}
DateTime DEPARTMENT_BRANCH_MODIFIED_DATE
{
get;
set;
}
bool DEPARTMENT_BRANCH_DELETED
{
get;
set;
}
}
#endregion
#region Property Class
public class ClsDepartmentBranchprp : IntDepartmentBranch122
{
private Int32 PRVDEPARTMENT_BRANCH_ID, PRVDEPARTMENT_BRANCH_DEPARTMENT_ID,
PRVDEPARTMENT_BRANCH_BRANCH_ID;
private Guid PRVDEPARTMENT_BRANCH_MODIFIED_BY, PRVDEPARTMENT_BRANCH_CREATED_BY;
DateTime PRVDEPARTMENT_BRANCH_CREATED_DATE, PRVDEPARTMENT_BRANCH_MODIFIED_DATE;
private bool PRVDEPARTMENT_BRANCH_DELETED;
#region IntDepartmentBranch Members
public int DEPARTMENT_BRANCH_ID
{
get
{
return PRVDEPARTMENT_BRANCH_ID;
}
set
{
PRVDEPARTMENT_BRANCH_ID = value;
}
}
public int DEPARTMENT_BRANCH_DEPARTMENT_ID
{
get
{
return PRVDEPARTMENT_BRANCH_DEPARTMENT_ID;
}
set
{
PRVDEPARTMENT_BRANCH_DEPARTMENT_ID = value;
}
}
public int DEPARTMENT_BRANCH_BRANCH_ID
{
get
{
return PRVDEPARTMENT_BRANCH_BRANCH_ID;
}
set
{
PRVDEPARTMENT_BRANCH_BRANCH_ID = value;
}
}
#endregion
#region IntDepartmentBranch Members
public Guid DEPARTMENT_BRANCH_CREATED_BY
{
get
{
return PRVDEPARTMENT_BRANCH_CREATED_BY;
}
set
{
PRVDEPARTMENT_BRANCH_CREATED_BY = value;
}
}
public Guid DEPARTMENT_BRANCH_MODIFIED_BY
{
get
{
return PRVDEPARTMENT_BRANCH_MODIFIED_BY;
}
set
{
PRVDEPARTMENT_BRANCH_MODIFIED_BY = value;
}
}
public DateTime DEPARTMENT_BRANCH_CREATED_DATE
{
get
{
return PRVDEPARTMENT_BRANCH_CREATED_DATE;
}
set
{
PRVDEPARTMENT_BRANCH_CREATED_DATE = value;
}
}
public DateTime DEPARTMENT_BRANCH_MODIFIED_DATE
{
get
{
return PRVDEPARTMENT_BRANCH_MODIFIED_DATE;
}
set
{
PRVDEPARTMENT_BRANCH_MODIFIED_DATE = value;
}
}
public bool DEPARTMENT_BRANCH_DELETED
{
get
{
return PRVDEPARTMENT_BRANCH_DELETED;
}
set
{
PRVDEPARTMENT_BRANCH_DELETED = value;
}
}
#endregion
}
#endregion
#region Main Class
public class ClsDepartmentBranch
{
clsmodule obj = new clsmodule();
public Int32 Save_DepartmentBranch(String dept_name, ClsDepartmentBranchprp deptbranch)
{
obj.conopen();
obj.cmd = new SqlCommand("SP_INS_DEPARTMENT_IN_BRANCH", obj.con);
obj.cmd.CommandType = CommandType.StoredProcedure;
obj.cmd.Parameters.Add("@DEPARTMENT", SqlDbType.NVarChar, 4000).Value = dept_name;
//obj.cmd.Parameters.Add("@DEPARTMENT_BRANCH_DEPARTMENT_ID", SqlDbType.Int).Value = deptbranch.DEPARTMENT_BRANCH_DEPARTMENT_ID;
obj.cmd.Parameters.Add("@DEPARTMENT_BRANCH_BRANCH_ID", SqlDbType.Int).Value = deptbranch.DEPARTMENT_BRANCH_BRANCH_ID;
int ret = obj.cmd.ExecuteNonQuery();
if (ret != 0)
{
return 1;
}
else
{
return 0;
}
}
public Int32 Update_DepartmentBranch(ClsDepartmentBranchprp deptbranch)
{
obj.conopen();
obj.cmd = new SqlCommand("SP_UPD_DEPARTMENT_IN_BRANCH", obj.con);
obj.cmd.CommandType = CommandType.StoredProcedure;
obj.cmd.Parameters.Add("@DEPARTMENT_BRANCH_ID", SqlDbType.Int).Value = deptbranch.DEPARTMENT_BRANCH_ID;
obj.cmd.Parameters.Add("@DEPARTMENT_BRANCH_DEPARTMENT_ID", SqlDbType.Int).Value = deptbranch.DEPARTMENT_BRANCH_DEPARTMENT_ID;
obj.cmd.Parameters.Add("@DEPARTMENT_BRANCH_BRANCH_ID", SqlDbType.Int).Value = deptbranch.DEPARTMENT_BRANCH_BRANCH_ID;
int ret = obj.cmd.ExecuteNonQuery();
if (ret == 1)
{
return 1;
}
else
{
return 0;
}
}
public Int32 Delete_DepartmentBranch(ClsDepartmentBranchprp deptbranch)
{
obj.conopen();
obj.cmd = new SqlCommand("SP_DEL_DEPARTMENT_IN_BRANCH", obj.con);
obj.cmd.CommandType = CommandType.StoredProcedure;
obj.cmd.Parameters.Add("@DEPARTMENT_BRANCH_ID", SqlDbType.Int).Value = deptbranch.DEPARTMENT_BRANCH_DEPARTMENT_ID;
int ret = obj.cmd.ExecuteNonQuery();
if (ret == 1)
{
return 1;
}
else
{
return 0;
}
}
}
#endregion
}
推荐答案
这篇关于名称空间已经包含一个定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!