/// <summary> /// 修改来源 /// </summary> void SourceUpdate() { MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true); int sourceid = int.Parse(nv["sourceid"]); string name = nv["name"]; int putin; if (!int.TryParse(nv["putin"], out putin)) { HttpContext.Current.Response.Write("参数错误"); return; } string intro = nv["intro"]; E_Source data = new E_Source(); data.PersonalID = pp.PersonalID; data.SourceID = sourceid; data.SourceCode = ""; data.SourceName = name; data.Putin = putin; data.Intro = intro; bool b = new T_Source().Update(data); HttpContext.Current.Response.Write(b ? "1" : "0"); }
/// <summary> /// 录入新来源 /// </summary> void SourceAdd() { MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true); string code = nv["code"]; string name = nv["name"]; string putin = nv["putin"]; string intro = nv["intro"]; E_Source data = new E_Source(); data.EnterpriseID = ep.EnterpriceID; data.SourceID = 0; data.SourceCode = code; data.SourceName = name; //if (!string.IsNullOrEmpty(putin)) //{ // data.Putin = Convert.ToInt32(putin); //} int num; if (!int.TryParse(putin, out num)) { HttpContext.Current.Response.Write("参数错误"); return; } data.Putin = num; data.Intro = intro; int areaid = new T_Source().Add(data); new MLMGC.BLL.Enterprise.T_Log().Add(new MLMGC.DataEntity.Enterprise.E_Log() { EnterpriseID = ep.EnterpriceID, UserID = ep.UserID, LogTitle = "添加来源", IP = MLMGC.COMP.Requests.GetRealIP() }); HttpContext.Current.Response.Write(areaid); }
/// <summary> /// 录入新来源 /// </summary> void SourceAdd() { MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true); string name = nv["name"]; int putin; if (!int.TryParse(nv["putin"], out putin)) { HttpContext.Current.Response.Write("参数错误"); return; } string intro = nv["intro"]; E_Source data = new E_Source(); data.PersonalID = pp.PersonalID; data.SourceID = 0; data.SourceCode = ""; data.SourceName = name; data.Putin = putin; data.Intro = intro; int areaid = new T_Source().Add(data); HttpContext.Current.Response.Write(areaid); }
/// <summary> /// 修改来源 /// </summary> void SourceUpdate() { MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true); int sourceid = int.Parse(nv["sourceid"]); string code = nv["code"]; string name = nv["name"]; string putin = nv["putin"]; string intro = nv["intro"]; E_Source data = new E_Source(); data.EnterpriseID = ep.EnterpriceID; data.SourceID = sourceid; data.SourceCode = code; data.SourceName = name; if (putin != null) { data.Putin = Convert.ToInt32(putin); } data.Intro = intro; bool b = new T_Source().Update(data); new MLMGC.BLL.Enterprise.T_Log().Add(new MLMGC.DataEntity.Enterprise.E_Log() { EnterpriseID = ep.EnterpriceID, UserID = ep.UserID, LogTitle = "修改来源", IP = MLMGC.COMP.Requests.GetRealIP() }); HttpContext.Current.Response.Write(b ? "1" : "0"); }
protected void databind() { E_Source data = new E_Source(); data.EnterpriseID = EnterpriceID; rpList.DataSource = new T_Source().GetList(data); rpList.DataBind(); }
/// <summary> /// 数据绑定 /// </summary> protected void databind() { E_Source data = new E_Source(); data.PersonalID = PersonalID; rpList.DataSource = new T_Source().GetList(data); rpList.DataBind(); }
/// <summary> /// 获取列表 /// </summary> /// <param name="data"></param> /// <returns></returns> /// <remarks>tianzhenyun 2011-10-20</remarks> public DataTable GetList(E_Source data) { SqlParameter[] parameters = { new SqlParameter("@PersonalID", SqlDbType.Int) }; parameters[0].Value = data.PersonalID; DataTable dt = DbHelperSQL.RunProcedureTable("ProcPI_B_Source_ListSelect", parameters); return(dt); }
/// <summary> /// 获取绑定显示的列表 /// </summary> /// <param name="data"></param> /// <returns></returns> /// <remarks>tianzhenyun 2011-10-20</remarks> public DataTable GetShowList(E_Source data) { SqlParameter[] parameters = { new SqlParameter("@PersonalID", SqlDbType.Int), new SqlParameter("@CodeIsValue", SqlDbType.TinyInt) }; parameters[0].Value = data.PersonalID; parameters[1].Value = data.CodeIsValue ? 1 : 2; return(DbHelperSQL.RunProcedureTable("ProcPI_B_Source_ShowListSelect", parameters)); }
/// <summary> /// 删除来源 /// </summary> void SourceDelete() { MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true); int sourceid = int.Parse(nv["sourceid"]); E_Source data = new E_Source(); data.PersonalID = pp.PersonalID; data.SourceID = sourceid; bool b = new T_Source().Delete(data); HttpContext.Current.Response.Write(b ? "1" : "0"); }
/// <summary> /// 来源是否存在 /// </summary> void SourceExists() { MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true); int sourceid = int.Parse(nv["sourceid"]); string code = nv["code"]; E_Source data = new E_Source(); data.EnterpriseID = ep.EnterpriceID; data.SourceID = sourceid; data.SourceCode = code; bool b = new T_Source().Exists(data); HttpContext.Current.Response.Write(b ? "1" : "0"); }
/// <summary> /// 删除一条数据 /// </summary> /// <remarks>tianzhenyun 2011-10-20</remarks> public bool Delete(E_Source data) { SqlParameter[] parameters = { new SqlParameter("@SourceID", SqlDbType.Int, 4), new SqlParameter("@PersonalID", SqlDbType.Int, 4) }; parameters[0].Value = data.SourceID; parameters[1].Value = data.PersonalID; int ReturnValue = 0; DbHelperSQL.RunProcedures("ProcPI_B_Source_Delete", parameters, out ReturnValue); return(ReturnValue > 0); }
/// <summary> /// 来源是否存在 /// </summary> void SourceExists() { MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true); int sourceid = int.Parse(nv["sourceid"]); string name = nv["name"]; E_Source data = new E_Source(); data.PersonalID = pp.PersonalID; data.SourceID = sourceid; data.SourceName = name; bool b = new T_Source().Exists(data); HttpContext.Current.Response.Write(b ? "1" : "0"); }
/// <summary> /// 删除来源 /// </summary> void SourceDelete() { MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true); int sourceid = int.Parse(nv["sourceid"]); E_Source data = new E_Source(); data.EnterpriseID = ep.EnterpriceID; data.SourceID = sourceid; bool b = new T_Source().Delete(data); new MLMGC.BLL.Enterprise.T_Log().Add(new MLMGC.DataEntity.Enterprise.E_Log() { EnterpriseID = ep.EnterpriceID, UserID = ep.UserID, LogTitle = "删除来源", IP = MLMGC.COMP.Requests.GetRealIP() }); HttpContext.Current.Response.Write(b ? "1" : "0"); }
/// <summary> /// 是否存在该记录 /// </summary> public bool Exists(E_Source data) { int ReturnValue; SqlParameter[] parameters = { new SqlParameter("@SourceID", SqlDbType.Int, 4), new SqlParameter("@EnterpriseID", SqlDbType.Int, 4), new SqlParameter("@SourceCode", SqlDbType.VarChar, 16) }; parameters[0].Value = data.SourceID; parameters[1].Value = data.EnterpriseID; parameters[2].Value = data.SourceCode; DbHelperSQL.RunProcedures("ProcEP_B_Source_Exists", parameters, out ReturnValue); return(ReturnValue > 0); }
/// <summary> /// 是否存在该记录 /// </summary> /// <remarks>tianzhenyun 2011-10-20</remarks> public bool Exists(E_Source data) { int ReturnValue; SqlParameter[] parameters = { new SqlParameter("@SourceID", SqlDbType.Int, 4), new SqlParameter("@PersonalID", SqlDbType.Int, 4), new SqlParameter("@SourceName", SqlDbType.VarChar, 128) }; parameters[0].Value = data.SourceID; parameters[1].Value = data.PersonalID; parameters[2].Value = data.SourceName; DbHelperSQL.RunProcedures("ProcPI_B_Source_Exists", parameters, out ReturnValue); return(ReturnValue > 0); }
/// <summary> /// 批量增加来源 /// </summary> /// <param name="data"></param> /// <returns></returns> /// <remarks>qipengfei 2011-10-25</remarks> public bool BatchAdd(E_Source data) { SqlParameter[] parms = { new SqlParameter("@PersonalID", SqlDbType.Int, 4), new SqlParameter("@Child_SourceCode", SqlDbType.NVarChar), new SqlParameter("@Child_SourceName", SqlDbType.NVarChar), new SqlParameter("@Separation", SqlDbType.VarChar, 2) }; parms[0].Value = data.PersonalID; parms[1].Value = data.SourceCodeS; parms[2].Value = data.SourceNameS; parms[3].Value = MLMGC.COMP.Config.Separation; int ReturnValue = 0; DbHelperSQL.RunProcedures("ProcPI_B_Source_BatchInsert", parms, out ReturnValue); return(ReturnValue > 0); }
/// <summary> /// 得到一个对象实体 /// </summary> /// <remarks>tianzhenyun 2011-10-20</remarks> public E_Source GetModel(E_Source data) { SqlParameter[] parameters = { new SqlParameter("@SourceID", SqlDbType.Int, 4), new SqlParameter("@PersonalID", SqlDbType.Int, 4) }; parameters[0].Value = data.SourceID; parameters[1].Value = data.PersonalID; DataTable dt = DbHelperSQL.RunProcedureTable("ProcPI_B_Source_Select", parameters); if (dt != null && dt.Rows.Count == 1) { data.SourceCode = dt.Rows[0]["SourceCode"].ToString(); data.SourceName = dt.Rows[0]["SourceName"].ToString(); data.Putin = Convert.ToInt32(dt.Rows[0]["Putin"]); data.Intro = dt.Rows[0]["Intro"].ToString(); return(data); } return(null); }
/// <summary> /// 更新一条数据 /// </summary> /// <remarks>tianzhenyun 2011-10-20</remarks> public bool Update(E_Source data) { SqlParameter[] parameters = { new SqlParameter("@SourceID", SqlDbType.Int, 4), new SqlParameter("@PersonalID", SqlDbType.Int, 4), new SqlParameter("@SourceCode", SqlDbType.VarChar, 32), new SqlParameter("@SourceName", SqlDbType.VarChar, 128), new SqlParameter("@Putin", SqlDbType.Int), new SqlParameter("@Intro", SqlDbType.VarChar, 512) }; parameters[0].Value = data.SourceID; parameters[1].Value = data.PersonalID; parameters[2].Value = data.SourceCode; parameters[3].Value = data.SourceName; parameters[4].Value = data.Putin; parameters[5].Value = data.Intro; int ReturnValue = 0; DbHelperSQL.RunProcedures("ProcPI_B_Source_Update", parameters, out ReturnValue); return(ReturnValue > 0); }
/// <summary> /// 得到一个对象实体 /// </summary> public E_Source GetModel(E_Source data) { SqlParameter[] parameters = { new SqlParameter("@SourceID", SqlDbType.Int, 4), new SqlParameter("@EnterpriseID", SqlDbType.Int, 4) }; parameters[0].Value = data.SourceID; parameters[1].Value = data.EnterpriseID; DataTable dt = DbHelperSQL.RunProcedureTable("ProcEP_B_Source_Select", parameters); if (dt != null && dt.Rows.Count == 1) { DataRow row = dt.Rows[0]; data.SourceCode = row["SourceCode"].ToString(); data.SourceName = row["SourceName"].ToString(); data.Putin = Convert.ToInt32(row["Putin"] == DBNull.Value ? 0 : row["Putin"]); data.Intro = row["Intro"].ToString(); return(data); } return(null); }
/// <summary> /// 增加一条数据 /// </summary> /// <remarks>tianzhenyun 2011-10-20</remarks> public int Add(E_Source data) { int rowsAffected; SqlParameter[] parameters = { new SqlParameter("@SourceID", SqlDbType.Int, 4), new SqlParameter("@PersonalID", SqlDbType.Int, 4), new SqlParameter("@SourceCode", SqlDbType.VarChar, 32), new SqlParameter("@SourceName", SqlDbType.VarChar, 128), new SqlParameter("@Putin", SqlDbType.Int), new SqlParameter("@Intro", SqlDbType.VarChar, 512) }; parameters[0].Direction = ParameterDirection.Output; parameters[1].Value = data.PersonalID; parameters[2].Value = data.SourceCode; parameters[3].Value = data.SourceName; parameters[4].Value = data.Putin; parameters[5].Value = data.Intro; DbHelperSQL.RunProcedure("ProcPI_B_Source_Insert", parameters, out rowsAffected); return((int)parameters[0].Value); }
/// <summary> /// 显示来源信息 /// </summary> void SourceShow() { MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true); int sourceid = int.Parse(nv["sourceid"]); E_Source data = new E_Source(); data.EnterpriseID = ep.EnterpriceID; data.SourceID = sourceid; data = new T_Source().GetModel(data); if (data == null) { data = new E_Source(); data.SourceID = 0; } JsonObjectCollection colDR = new JsonObjectCollection(); colDR.Add(new JsonStringValue("id", data.SourceID.ToString())); colDR.Add(new JsonStringValue("code", data.SourceCode)); colDR.Add(new JsonStringValue("name", data.SourceName)); colDR.Add(new JsonStringValue("putin", data.Putin.ToString())); colDR.Add(new JsonStringValue("intro", data.Intro)); HttpContext.Current.Response.Write(colDR.ToString()); }
/// <summary> /// 得到一个对象实体 /// </summary> public E_Source GetModel(E_Source data) { return(dal.GetModel(data)); }
/// <summary> /// 是否存在该记录 /// </summary> public bool Exists(E_Source data) { return(dal.Exists(data)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(E_Source data) { return(dal.Add(data)); }
/// <summary> /// 删除一条数据 /// </summary> public bool Delete(E_Source data) { return(dal.Delete(data)); }
/// <summary> /// 批量增加来源 /// </summary> /// <param name="data"></param> /// <returns></returns> /// <remarks>qipengfei 2011-10-25</remarks> public bool BatchAdd(E_Source data) { return(dal.BatchAdd(data)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(E_Source data) { return(dal.Update(data)); }
/// <summary> /// 获取绑定显示的列表 /// </summary> /// <param name="data"></param> /// <returns></returns> public DataTable GetShowList(E_Source data) { return(dal.GetShowList(data)); }