Esempio n. 1
0
        /// <summary>
        /// 更新PCD_Queue对象(即:一条记录
        /// </summary>
        public int Update(PCD_Queue pCD_Queue)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       PCD_Queue       SET ");
            if (pCD_Queue.PCDO_PlanCode_IsChanged)
            {
                sbParameter.Append("PCDO_PlanCode=@PCDO_PlanCode, ");
            }
            if (pCD_Queue.PCDO_NCode_IsChanged)
            {
                sbParameter.Append("PCDO_NCode=@PCDO_NCode, ");
            }
            if (pCD_Queue.PCDO_Order_IsChanged)
            {
                sbParameter.Append("PCDO_Order=@PCDO_Order, ");
            }
            if (pCD_Queue.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and PCDO_ID=@PCDO_ID; ");
            string sql = sb.ToString();

            if (pCD_Queue.PCDO_PlanCode_IsChanged)
            {
                if (string.IsNullOrEmpty(pCD_Queue.PCDO_PlanCode))
                {
                    idb.AddParameter("@PCDO_PlanCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCDO_PlanCode", pCD_Queue.PCDO_PlanCode);
                }
            }
            if (pCD_Queue.PCDO_NCode_IsChanged)
            {
                if (string.IsNullOrEmpty(pCD_Queue.PCDO_NCode))
                {
                    idb.AddParameter("@PCDO_NCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCDO_NCode", pCD_Queue.PCDO_NCode);
                }
            }
            if (pCD_Queue.PCDO_Order_IsChanged)
            {
                if (pCD_Queue.PCDO_Order == 0)
                {
                    idb.AddParameter("@PCDO_Order", 0);
                }
                else
                {
                    idb.AddParameter("@PCDO_Order", pCD_Queue.PCDO_Order);
                }
            }
            if (pCD_Queue.Stat_IsChanged)
            {
                if (pCD_Queue.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", pCD_Queue.Stat);
                }
            }

            idb.AddParameter("@PCDO_ID", pCD_Queue.PCDO_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 2
0
        /// <summary>
        /// 添加审核阶段信息 Verify_Nodes对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Verify_Nodes verify_Nodes)
        {
            string sql = "INSERT INTO Verify_Nodes (VerifyNode_Code,VerifyNode_Name,VerifyNode_Remark,VerifyNode_AuditNum,Stat) VALUES (@VerifyNode_Code,@VerifyNode_Name,@VerifyNode_Remark,@VerifyNode_AuditNum,@Stat);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(verify_Nodes.VerifyNode_Code))
            {
                idb.AddParameter("@VerifyNode_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyNode_Code", verify_Nodes.VerifyNode_Code);
            }
            if (string.IsNullOrEmpty(verify_Nodes.VerifyNode_Name))
            {
                idb.AddParameter("@VerifyNode_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyNode_Name", verify_Nodes.VerifyNode_Name);
            }
            if (string.IsNullOrEmpty(verify_Nodes.VerifyNode_Remark))
            {
                idb.AddParameter("@VerifyNode_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyNode_Remark", verify_Nodes.VerifyNode_Remark);
            }
            if (verify_Nodes.VerifyNode_AuditNum == 0)
            {
                idb.AddParameter("@VerifyNode_AuditNum", 0);
            }
            else
            {
                idb.AddParameter("@VerifyNode_AuditNum", verify_Nodes.VerifyNode_AuditNum);
            }
            if (verify_Nodes.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", verify_Nodes.Stat);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                var Return = idb.ReturnValue(sql);
                Ex = Return.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 3
0
        /// <summary>
        /// 添加外联协调信息 Outreach_Coordination对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Outreach_Coordination outreach_Coordination)
        {
            string sql = "INSERT INTO Outreach_Coordination (OC_Code,OC_OutretachCode,OC_OutreachName,OC_CoordinationType,OC_MainContactor,OC_Telephone,OC_Content,OC_Result,OC_ResultType,OC_Cost,OC_Remark,OC_Attachment,OC_Company,OC_Dept,OC_iType,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@OC_Code,@OC_OutretachCode,@OC_OutreachName,@OC_CoordinationType,@OC_MainContactor,@OC_Telephone,@OC_Content,@OC_Result,@OC_ResultType,@OC_Cost,@OC_Remark,@OC_Attachment,@OC_Company,@OC_Dept,@OC_iType,@Stat,@CreateDate,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(outreach_Coordination.OC_Code))
            {
                idb.AddParameter("@OC_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Code", outreach_Coordination.OC_Code);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_OutretachCode))
            {
                idb.AddParameter("@OC_OutretachCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_OutretachCode", outreach_Coordination.OC_OutretachCode);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_OutreachName))
            {
                idb.AddParameter("@OC_OutreachName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_OutreachName", outreach_Coordination.OC_OutreachName);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_CoordinationType))
            {
                idb.AddParameter("@OC_CoordinationType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_CoordinationType", outreach_Coordination.OC_CoordinationType);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_MainContactor))
            {
                idb.AddParameter("@OC_MainContactor", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_MainContactor", outreach_Coordination.OC_MainContactor);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Telephone))
            {
                idb.AddParameter("@OC_Telephone", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Telephone", outreach_Coordination.OC_Telephone);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Content))
            {
                idb.AddParameter("@OC_Content", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Content", outreach_Coordination.OC_Content);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Result))
            {
                idb.AddParameter("@OC_Result", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Result", outreach_Coordination.OC_Result);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_ResultType))
            {
                idb.AddParameter("@OC_ResultType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_ResultType", outreach_Coordination.OC_ResultType);
            }
            if (outreach_Coordination.OC_Cost == 0)
            {
                idb.AddParameter("@OC_Cost", 0);
            }
            else
            {
                idb.AddParameter("@OC_Cost", outreach_Coordination.OC_Cost);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Remark))
            {
                idb.AddParameter("@OC_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Remark", outreach_Coordination.OC_Remark);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Attachment))
            {
                idb.AddParameter("@OC_Attachment", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Attachment", outreach_Coordination.OC_Attachment);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Company))
            {
                idb.AddParameter("@OC_Company", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Company", outreach_Coordination.OC_Company);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_Dept))
            {
                idb.AddParameter("@OC_Dept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_Dept", outreach_Coordination.OC_Dept);
            }
            if (string.IsNullOrEmpty(outreach_Coordination.OC_iType))
            {
                idb.AddParameter("@OC_iType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OC_iType", outreach_Coordination.OC_iType);
            }
            if (outreach_Coordination.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", outreach_Coordination.Stat);
            }
            if (outreach_Coordination.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", outreach_Coordination.CreateDate);
            }
            if (outreach_Coordination.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", outreach_Coordination.UpdateDate);
            }
            if (outreach_Coordination.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", outreach_Coordination.DeleteDate);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                var Return = idb.ReturnValue(sql);
                Ex = Return.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 4
0
        /// <summary>
        /// 更新公司物料类别 WH_MaterialType对象(即:一条记录
        /// </summary>
        public int Update(WH_MaterialType wH_MaterialType)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       WH_MaterialType       SET ");
            if (wH_MaterialType.MT_Code_IsChanged)
            {
                sbParameter.Append("MT_Code=@MT_Code, ");
            }
            if (wH_MaterialType.MT_TCode_IsChanged)
            {
                sbParameter.Append("MT_TCode=@MT_TCode, ");
            }
            if (wH_MaterialType.MT_TName_IsChanged)
            {
                sbParameter.Append("MT_TName=@MT_TName, ");
            }
            if (wH_MaterialType.MT_Company_IsChanged)
            {
                sbParameter.Append("MT_Company=@MT_Company, ");
            }
            if (wH_MaterialType.MT_CompanyCode_IsChanged)
            {
                sbParameter.Append("MT_CompanyCode=@MT_CompanyCode, ");
            }
            if (wH_MaterialType.MT_Dept_IsChanged)
            {
                sbParameter.Append("MT_Dept=@MT_Dept, ");
            }
            if (wH_MaterialType.MT_DeptCode_IsChanged)
            {
                sbParameter.Append("MT_DeptCode=@MT_DeptCode, ");
            }
            if (wH_MaterialType.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat, ");
            }
            if (wH_MaterialType.MT_Status_IsChanged)
            {
                sbParameter.Append("MT_Status=@MT_Status, ");
            }
            if (wH_MaterialType.CreateDate_IsChanged)
            {
                sbParameter.Append("CreateDate=@CreateDate, ");
            }
            if (wH_MaterialType.UpdateDate_IsChanged)
            {
                sbParameter.Append("UpdateDate=@UpdateDate, ");
            }
            if (wH_MaterialType.DeleteDate_IsChanged)
            {
                sbParameter.Append("DeleteDate=@DeleteDate, ");
            }
            if (wH_MaterialType.MT_Itype_IsChanged)
            {
                sbParameter.Append("MT_Itype=@MT_Itype, ");
            }
            if (wH_MaterialType.MT_Type_IsChanged)
            {
                sbParameter.Append("MT_Type=@MT_Type, ");
            }
            if (wH_MaterialType.MT_Employee_IsChanged)
            {
                sbParameter.Append("MT_Employee=@MT_Employee, ");
            }
            if (wH_MaterialType.MT_EmployeeName_IsChanged)
            {
                sbParameter.Append("MT_EmployeeName=@MT_EmployeeName, ");
            }
            if (wH_MaterialType.MT_TPCode_IsChanged)
            {
                sbParameter.Append("MT_TPCode=@MT_TPCode, ");
            }
            if (wH_MaterialType.MT_Order_IsChanged)
            {
                sbParameter.Append("MT_Order=@MT_Order ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and MT_ID=@MT_ID; ");
            string sql = sb.ToString();

            if (wH_MaterialType.MT_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_Code))
                {
                    idb.AddParameter("@MT_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_Code", wH_MaterialType.MT_Code);
                }
            }
            if (wH_MaterialType.MT_TCode_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_TCode))
                {
                    idb.AddParameter("@MT_TCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_TCode", wH_MaterialType.MT_TCode);
                }
            }
            if (wH_MaterialType.MT_TName_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_TName))
                {
                    idb.AddParameter("@MT_TName", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_TName", wH_MaterialType.MT_TName);
                }
            }
            if (wH_MaterialType.MT_Company_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_Company))
                {
                    idb.AddParameter("@MT_Company", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_Company", wH_MaterialType.MT_Company);
                }
            }
            if (wH_MaterialType.MT_CompanyCode_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_CompanyCode))
                {
                    idb.AddParameter("@MT_CompanyCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_CompanyCode", wH_MaterialType.MT_CompanyCode);
                }
            }
            if (wH_MaterialType.MT_Dept_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_Dept))
                {
                    idb.AddParameter("@MT_Dept", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_Dept", wH_MaterialType.MT_Dept);
                }
            }
            if (wH_MaterialType.MT_DeptCode_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_DeptCode))
                {
                    idb.AddParameter("@MT_DeptCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_DeptCode", wH_MaterialType.MT_DeptCode);
                }
            }
            if (wH_MaterialType.Stat_IsChanged)
            {
                if (wH_MaterialType.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", wH_MaterialType.Stat);
                }
            }
            if (wH_MaterialType.MT_Status_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_Status))
                {
                    idb.AddParameter("@MT_Status", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_Status", wH_MaterialType.MT_Status);
                }
            }
            if (wH_MaterialType.CreateDate_IsChanged)
            {
                if (wH_MaterialType.CreateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@CreateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@CreateDate", wH_MaterialType.CreateDate);
                }
            }
            if (wH_MaterialType.UpdateDate_IsChanged)
            {
                if (wH_MaterialType.UpdateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@UpdateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@UpdateDate", wH_MaterialType.UpdateDate);
                }
            }
            if (wH_MaterialType.DeleteDate_IsChanged)
            {
                if (wH_MaterialType.DeleteDate == DateTime.MinValue)
                {
                    idb.AddParameter("@DeleteDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@DeleteDate", wH_MaterialType.DeleteDate);
                }
            }
            if (wH_MaterialType.MT_Itype_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_Itype))
                {
                    idb.AddParameter("@MT_Itype", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_Itype", wH_MaterialType.MT_Itype);
                }
            }
            if (wH_MaterialType.MT_Type_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_Type))
                {
                    idb.AddParameter("@MT_Type", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_Type", wH_MaterialType.MT_Type);
                }
            }
            if (wH_MaterialType.MT_Employee_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_Employee))
                {
                    idb.AddParameter("@MT_Employee", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_Employee", wH_MaterialType.MT_Employee);
                }
            }
            if (wH_MaterialType.MT_EmployeeName_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_EmployeeName))
                {
                    idb.AddParameter("@MT_EmployeeName", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_EmployeeName", wH_MaterialType.MT_EmployeeName);
                }
            }
            if (wH_MaterialType.MT_TPCode_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_MaterialType.MT_TPCode))
                {
                    idb.AddParameter("@MT_TPCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MT_TPCode", wH_MaterialType.MT_TPCode);
                }
            }
            if (wH_MaterialType.MT_Order_IsChanged)
            {
                if (wH_MaterialType.MT_Order == 0)
                {
                    idb.AddParameter("@MT_Order", 0);
                }
                else
                {
                    idb.AddParameter("@MT_Order", wH_MaterialType.MT_Order);
                }
            }

            idb.AddParameter("@MT_ID", wH_MaterialType.MT_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 5
0
        /// <summary>
        /// 更新搅拌站信息 PC_BStation对象(即:一条记录
        /// </summary>
        public int Update(PC_BStation pC_BStation)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       PC_BStation       SET ");
            if (pC_BStation.PCBS_Code_IsChanged)
            {
                sbParameter.Append("PCBS_Code=@PCBS_Code, ");
            }
            if (pC_BStation.PCBS_Name_IsChanged)
            {
                sbParameter.Append("PCBS_Name=@PCBS_Name, ");
            }
            if (pC_BStation.PCBS_Addr_IsChanged)
            {
                sbParameter.Append("PCBS_Addr=@PCBS_Addr, ");
            }
            if (pC_BStation.PCBS_Start_IsChanged)
            {
                sbParameter.Append("PCBS_Start=@PCBS_Start, ");
            }
            if (pC_BStation.PCBS_Status_IsChanged)
            {
                sbParameter.Append("PCBS_Status=@PCBS_Status, ");
            }
            if (pC_BStation.PCBS_Bak_IsChanged)
            {
                sbParameter.Append("PCBS_Bak=@PCBS_Bak, ");
            }
            if (pC_BStation.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat, ");
            }
            if (pC_BStation.CreateDate_IsChanged)
            {
                sbParameter.Append("CreateDate=@CreateDate, ");
            }
            if (pC_BStation.UpdateDate_IsChanged)
            {
                sbParameter.Append("UpdateDate=@UpdateDate, ");
            }
            if (pC_BStation.DeleteDate_IsChanged)
            {
                sbParameter.Append("DeleteDate=@DeleteDate ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and PCBS_ID=@PCBS_ID; ");
            string sql = sb.ToString();

            if (pC_BStation.PCBS_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(pC_BStation.PCBS_Code))
                {
                    idb.AddParameter("@PCBS_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCBS_Code", pC_BStation.PCBS_Code);
                }
            }
            if (pC_BStation.PCBS_Name_IsChanged)
            {
                if (string.IsNullOrEmpty(pC_BStation.PCBS_Name))
                {
                    idb.AddParameter("@PCBS_Name", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCBS_Name", pC_BStation.PCBS_Name);
                }
            }
            if (pC_BStation.PCBS_Addr_IsChanged)
            {
                if (string.IsNullOrEmpty(pC_BStation.PCBS_Addr))
                {
                    idb.AddParameter("@PCBS_Addr", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCBS_Addr", pC_BStation.PCBS_Addr);
                }
            }
            if (pC_BStation.PCBS_Start_IsChanged)
            {
                if (pC_BStation.PCBS_Start == DateTime.MinValue)
                {
                    idb.AddParameter("@PCBS_Start", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCBS_Start", pC_BStation.PCBS_Start);
                }
            }
            if (pC_BStation.PCBS_Status_IsChanged)
            {
                if (string.IsNullOrEmpty(pC_BStation.PCBS_Status))
                {
                    idb.AddParameter("@PCBS_Status", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCBS_Status", pC_BStation.PCBS_Status);
                }
            }
            if (pC_BStation.PCBS_Bak_IsChanged)
            {
                if (string.IsNullOrEmpty(pC_BStation.PCBS_Bak))
                {
                    idb.AddParameter("@PCBS_Bak", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCBS_Bak", pC_BStation.PCBS_Bak);
                }
            }
            if (pC_BStation.Stat_IsChanged)
            {
                if (pC_BStation.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", pC_BStation.Stat);
                }
            }
            if (pC_BStation.CreateDate_IsChanged)
            {
                if (pC_BStation.CreateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@CreateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@CreateDate", pC_BStation.CreateDate);
                }
            }
            if (pC_BStation.UpdateDate_IsChanged)
            {
                if (pC_BStation.UpdateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@UpdateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@UpdateDate", pC_BStation.UpdateDate);
                }
            }
            if (pC_BStation.DeleteDate_IsChanged)
            {
                if (pC_BStation.DeleteDate == DateTime.MinValue)
                {
                    idb.AddParameter("@DeleteDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@DeleteDate", pC_BStation.DeleteDate);
                }
            }

            idb.AddParameter("@PCBS_ID", pC_BStation.PCBS_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 6
0
        /// <summary>
        /// 添加Bug管理系统 Sys_Bug对象(即:一条记录)
        /// </summary>
        public int Add(Sys_Bug sys_Bug)
        {
            string sql = "INSERT INTO Sys_Bug (Sys_Code,Sys_Date,Sys_Title,Sys_Des,Sys_Project,Sys_Module,Sys_UserCode,Sys_UserName,Sys_Owner,Sys_OpUser,Sys_Status,Stat) VALUES (@Sys_Code,@Sys_Date,@Sys_Title,@Sys_Des,@Sys_Project,@Sys_Module,@Sys_UserCode,@Sys_UserName,@Sys_Owner,@Sys_OpUser,@Sys_Status,@Stat)";

            if (string.IsNullOrEmpty(sys_Bug.Sys_Code))
            {
                idb.AddParameter("@Sys_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_Code", sys_Bug.Sys_Code);
            }
            if (sys_Bug.Sys_Date == DateTime.MinValue)
            {
                idb.AddParameter("@Sys_Date", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_Date", sys_Bug.Sys_Date);
            }
            if (string.IsNullOrEmpty(sys_Bug.Sys_Title))
            {
                idb.AddParameter("@Sys_Title", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_Title", sys_Bug.Sys_Title);
            }
            if (string.IsNullOrEmpty(sys_Bug.Sys_Des))
            {
                idb.AddParameter("@Sys_Des", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_Des", sys_Bug.Sys_Des);
            }
            if (string.IsNullOrEmpty(sys_Bug.Sys_Project))
            {
                idb.AddParameter("@Sys_Project", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_Project", sys_Bug.Sys_Project);
            }
            if (string.IsNullOrEmpty(sys_Bug.Sys_Module))
            {
                idb.AddParameter("@Sys_Module", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_Module", sys_Bug.Sys_Module);
            }
            if (string.IsNullOrEmpty(sys_Bug.Sys_UserCode))
            {
                idb.AddParameter("@Sys_UserCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_UserCode", sys_Bug.Sys_UserCode);
            }
            if (string.IsNullOrEmpty(sys_Bug.Sys_UserName))
            {
                idb.AddParameter("@Sys_UserName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_UserName", sys_Bug.Sys_UserName);
            }
            if (string.IsNullOrEmpty(sys_Bug.Sys_Owner))
            {
                idb.AddParameter("@Sys_Owner", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_Owner", sys_Bug.Sys_Owner);
            }
            if (string.IsNullOrEmpty(sys_Bug.Sys_OpUser))
            {
                idb.AddParameter("@Sys_OpUser", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_OpUser", sys_Bug.Sys_OpUser);
            }
            if (string.IsNullOrEmpty(sys_Bug.Sys_Status))
            {
                idb.AddParameter("@Sys_Status", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Sys_Status", sys_Bug.Sys_Status);
            }
            if (sys_Bug.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", sys_Bug.Stat);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 7
0
        /// <summary>
        /// 添加外联单位管理 Outreach_Info对象(即:一条记录)
        /// </summary>
        public int Add(Outreach_Info outreach_Info)
        {
            string sql = "INSERT INTO Outreach_Info (OI_Code,OI_Name,OI_Address,OI_Telephone,OI_CompanyType,OI_iType,OI_MainContactor,OI_ContactPhone,OI_Contactor,Ol_Attachment,OI_Remark,OI_Company,OI_Dept,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@OI_Code,@OI_Name,@OI_Address,@OI_Telephone,@OI_CompanyType,@OI_iType,@OI_MainContactor,@OI_ContactPhone,@OI_Contactor,@Ol_Attachment,@OI_Remark,@OI_Company,@OI_Dept,@Stat,@CreateDate,@UpdateDate,@DeleteDate)";

            if (string.IsNullOrEmpty(outreach_Info.OI_Code))
            {
                idb.AddParameter("@OI_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_Code", outreach_Info.OI_Code);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_Name))
            {
                idb.AddParameter("@OI_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_Name", outreach_Info.OI_Name);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_Address))
            {
                idb.AddParameter("@OI_Address", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_Address", outreach_Info.OI_Address);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_Telephone))
            {
                idb.AddParameter("@OI_Telephone", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_Telephone", outreach_Info.OI_Telephone);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_CompanyType))
            {
                idb.AddParameter("@OI_CompanyType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_CompanyType", outreach_Info.OI_CompanyType);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_iType))
            {
                idb.AddParameter("@OI_iType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_iType", outreach_Info.OI_iType);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_MainContactor))
            {
                idb.AddParameter("@OI_MainContactor", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_MainContactor", outreach_Info.OI_MainContactor);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_ContactPhone))
            {
                idb.AddParameter("@OI_ContactPhone", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_ContactPhone", outreach_Info.OI_ContactPhone);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_Contactor))
            {
                idb.AddParameter("@OI_Contactor", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_Contactor", outreach_Info.OI_Contactor);
            }
            if (string.IsNullOrEmpty(outreach_Info.Ol_Attachment))
            {
                idb.AddParameter("@Ol_Attachment", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Ol_Attachment", outreach_Info.Ol_Attachment);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_Remark))
            {
                idb.AddParameter("@OI_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_Remark", outreach_Info.OI_Remark);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_Company))
            {
                idb.AddParameter("@OI_Company", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_Company", outreach_Info.OI_Company);
            }
            if (string.IsNullOrEmpty(outreach_Info.OI_Dept))
            {
                idb.AddParameter("@OI_Dept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@OI_Dept", outreach_Info.OI_Dept);
            }
            if (outreach_Info.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", outreach_Info.Stat);
            }
            if (outreach_Info.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", outreach_Info.CreateDate);
            }
            if (outreach_Info.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", outreach_Info.UpdateDate);
            }
            if (outreach_Info.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", outreach_Info.DeleteDate);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 8
0
        /// <summary>
        /// 添加Assets_Apply对象(即:一条记录)
        /// </summary>
        public int Add(Assets_Apply assets_Apply)
        {
            string sql = "INSERT INTO Assets_Apply (AssetsApply_Code,AssetsApply_AppPerson,AssetsApply_AppDept,AssetsApply_AppName,AssetsApply_Parameter,AssetsApply_Description,AssetsApply_AppCount,AssetsApply_Type,AssetsApply_AppType,AssetsApply_Date,AssetsApply_AudistStat,AssetsApply_Stat,AssetsApply_Remark,Stat) VALUES (@AssetsApply_Code,@AssetsApply_AppPerson,@AssetsApply_AppDept,@AssetsApply_AppName,@AssetsApply_Parameter,@AssetsApply_Description,@AssetsApply_AppCount,@AssetsApply_Type,@AssetsApply_AppType,@AssetsApply_Date,@AssetsApply_AudistStat,@AssetsApply_Stat,@AssetsApply_Remark,@Stat)";

            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Code))
            {
                idb.AddParameter("@AssetsApply_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Code", assets_Apply.AssetsApply_Code);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppPerson))
            {
                idb.AddParameter("@AssetsApply_AppPerson", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppPerson", assets_Apply.AssetsApply_AppPerson);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppDept))
            {
                idb.AddParameter("@AssetsApply_AppDept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppDept", assets_Apply.AssetsApply_AppDept);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppName))
            {
                idb.AddParameter("@AssetsApply_AppName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppName", assets_Apply.AssetsApply_AppName);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Parameter))
            {
                idb.AddParameter("@AssetsApply_Parameter", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Parameter", assets_Apply.AssetsApply_Parameter);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Description))
            {
                idb.AddParameter("@AssetsApply_Description", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Description", assets_Apply.AssetsApply_Description);
            }
            if (assets_Apply.AssetsApply_AppCount == 0)
            {
                idb.AddParameter("@AssetsApply_AppCount", 0);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppCount", assets_Apply.AssetsApply_AppCount);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Type))
            {
                idb.AddParameter("@AssetsApply_Type", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Type", assets_Apply.AssetsApply_Type);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppType))
            {
                idb.AddParameter("@AssetsApply_AppType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AppType", assets_Apply.AssetsApply_AppType);
            }
            if (assets_Apply.AssetsApply_Date == DateTime.MinValue)
            {
                idb.AddParameter("@AssetsApply_Date", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Date", assets_Apply.AssetsApply_Date);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AudistStat))
            {
                idb.AddParameter("@AssetsApply_AudistStat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_AudistStat", assets_Apply.AssetsApply_AudistStat);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Stat))
            {
                idb.AddParameter("@AssetsApply_Stat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Stat", assets_Apply.AssetsApply_Stat);
            }
            if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Remark))
            {
                idb.AddParameter("@AssetsApply_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@AssetsApply_Remark", assets_Apply.AssetsApply_Remark);
            }
            if (assets_Apply.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", assets_Apply.Stat);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 9
0
        /// <summary>
        /// 更新Assets_Apply对象(即:一条记录
        /// </summary>
        public int Update(Assets_Apply assets_Apply)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       Assets_Apply       SET ");
            if (assets_Apply.AssetsApply_Code_IsChanged)
            {
                sbParameter.Append("AssetsApply_Code=@AssetsApply_Code, ");
            }
            if (assets_Apply.AssetsApply_AppPerson_IsChanged)
            {
                sbParameter.Append("AssetsApply_AppPerson=@AssetsApply_AppPerson, ");
            }
            if (assets_Apply.AssetsApply_AppDept_IsChanged)
            {
                sbParameter.Append("AssetsApply_AppDept=@AssetsApply_AppDept, ");
            }
            if (assets_Apply.AssetsApply_AppName_IsChanged)
            {
                sbParameter.Append("AssetsApply_AppName=@AssetsApply_AppName, ");
            }
            if (assets_Apply.AssetsApply_Parameter_IsChanged)
            {
                sbParameter.Append("AssetsApply_Parameter=@AssetsApply_Parameter, ");
            }
            if (assets_Apply.AssetsApply_Description_IsChanged)
            {
                sbParameter.Append("AssetsApply_Description=@AssetsApply_Description, ");
            }
            if (assets_Apply.AssetsApply_AppCount_IsChanged)
            {
                sbParameter.Append("AssetsApply_AppCount=@AssetsApply_AppCount, ");
            }
            if (assets_Apply.AssetsApply_Type_IsChanged)
            {
                sbParameter.Append("AssetsApply_Type=@AssetsApply_Type, ");
            }
            if (assets_Apply.AssetsApply_AppType_IsChanged)
            {
                sbParameter.Append("AssetsApply_AppType=@AssetsApply_AppType, ");
            }
            if (assets_Apply.AssetsApply_Date_IsChanged)
            {
                sbParameter.Append("AssetsApply_Date=@AssetsApply_Date, ");
            }
            if (assets_Apply.AssetsApply_AudistStat_IsChanged)
            {
                sbParameter.Append("AssetsApply_AudistStat=@AssetsApply_AudistStat, ");
            }
            if (assets_Apply.AssetsApply_Stat_IsChanged)
            {
                sbParameter.Append("AssetsApply_Stat=@AssetsApply_Stat, ");
            }
            if (assets_Apply.AssetsApply_Remark_IsChanged)
            {
                sbParameter.Append("AssetsApply_Remark=@AssetsApply_Remark, ");
            }
            if (assets_Apply.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and AssetsApply_ID=@AssetsApply_ID; ");
            string sql = sb.ToString();

            if (assets_Apply.AssetsApply_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Code))
                {
                    idb.AddParameter("@AssetsApply_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_Code", assets_Apply.AssetsApply_Code);
                }
            }
            if (assets_Apply.AssetsApply_AppPerson_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppPerson))
                {
                    idb.AddParameter("@AssetsApply_AppPerson", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_AppPerson", assets_Apply.AssetsApply_AppPerson);
                }
            }
            if (assets_Apply.AssetsApply_AppDept_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppDept))
                {
                    idb.AddParameter("@AssetsApply_AppDept", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_AppDept", assets_Apply.AssetsApply_AppDept);
                }
            }
            if (assets_Apply.AssetsApply_AppName_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppName))
                {
                    idb.AddParameter("@AssetsApply_AppName", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_AppName", assets_Apply.AssetsApply_AppName);
                }
            }
            if (assets_Apply.AssetsApply_Parameter_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Parameter))
                {
                    idb.AddParameter("@AssetsApply_Parameter", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_Parameter", assets_Apply.AssetsApply_Parameter);
                }
            }
            if (assets_Apply.AssetsApply_Description_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Description))
                {
                    idb.AddParameter("@AssetsApply_Description", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_Description", assets_Apply.AssetsApply_Description);
                }
            }
            if (assets_Apply.AssetsApply_AppCount_IsChanged)
            {
                if (assets_Apply.AssetsApply_AppCount == 0)
                {
                    idb.AddParameter("@AssetsApply_AppCount", 0);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_AppCount", assets_Apply.AssetsApply_AppCount);
                }
            }
            if (assets_Apply.AssetsApply_Type_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Type))
                {
                    idb.AddParameter("@AssetsApply_Type", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_Type", assets_Apply.AssetsApply_Type);
                }
            }
            if (assets_Apply.AssetsApply_AppType_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AppType))
                {
                    idb.AddParameter("@AssetsApply_AppType", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_AppType", assets_Apply.AssetsApply_AppType);
                }
            }
            if (assets_Apply.AssetsApply_Date_IsChanged)
            {
                if (assets_Apply.AssetsApply_Date == DateTime.MinValue)
                {
                    idb.AddParameter("@AssetsApply_Date", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_Date", assets_Apply.AssetsApply_Date);
                }
            }
            if (assets_Apply.AssetsApply_AudistStat_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_AudistStat))
                {
                    idb.AddParameter("@AssetsApply_AudistStat", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_AudistStat", assets_Apply.AssetsApply_AudistStat);
                }
            }
            if (assets_Apply.AssetsApply_Stat_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Stat))
                {
                    idb.AddParameter("@AssetsApply_Stat", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_Stat", assets_Apply.AssetsApply_Stat);
                }
            }
            if (assets_Apply.AssetsApply_Remark_IsChanged)
            {
                if (string.IsNullOrEmpty(assets_Apply.AssetsApply_Remark))
                {
                    idb.AddParameter("@AssetsApply_Remark", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@AssetsApply_Remark", assets_Apply.AssetsApply_Remark);
                }
            }
            if (assets_Apply.Stat_IsChanged)
            {
                if (assets_Apply.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", assets_Apply.Stat);
                }
            }

            idb.AddParameter("@AssetsApply_ID", assets_Apply.AssetsApply_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 10
0
        /// <summary>
        /// 添加合同细目信息 WH_CItem对象(即:一条记录)
        /// </summary>
        public int Add(WH_CItem wH_CItem)
        {
            string sql = "INSERT INTO WH_CItem (WHCI_CCode,WHCI_MCode,WHCI_Num,WHCI_Unit,WHCI_Manu,WHCI_MDate,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@WHCI_CCode,@WHCI_MCode,@WHCI_Num,@WHCI_Unit,@WHCI_Manu,@WHCI_MDate,@Stat,@CreateDate,@UpdateDate,@DeleteDate)";

            if (string.IsNullOrEmpty(wH_CItem.WHCI_CCode))
            {
                idb.AddParameter("@WHCI_CCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_CCode", wH_CItem.WHCI_CCode);
            }
            if (string.IsNullOrEmpty(wH_CItem.WHCI_MCode))
            {
                idb.AddParameter("@WHCI_MCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_MCode", wH_CItem.WHCI_MCode);
            }
            if (wH_CItem.WHCI_Num == 0)
            {
                idb.AddParameter("@WHCI_Num", 0);
            }
            else
            {
                idb.AddParameter("@WHCI_Num", wH_CItem.WHCI_Num);
            }
            if (string.IsNullOrEmpty(wH_CItem.WHCI_Unit))
            {
                idb.AddParameter("@WHCI_Unit", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_Unit", wH_CItem.WHCI_Unit);
            }
            if (string.IsNullOrEmpty(wH_CItem.WHCI_Manu))
            {
                idb.AddParameter("@WHCI_Manu", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_Manu", wH_CItem.WHCI_Manu);
            }
            if (wH_CItem.WHCI_MDate == DateTime.MinValue)
            {
                idb.AddParameter("@WHCI_MDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@WHCI_MDate", wH_CItem.WHCI_MDate);
            }
            if (wH_CItem.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", wH_CItem.Stat);
            }
            if (wH_CItem.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", wH_CItem.CreateDate);
            }
            if (wH_CItem.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", wH_CItem.UpdateDate);
            }
            if (wH_CItem.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", wH_CItem.DeleteDate);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 11
0
        /// <summary>
        /// 更新合同细目信息 WH_CItem对象(即:一条记录
        /// </summary>
        public int Update(WH_CItem wH_CItem)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       WH_CItem       SET ");
            if (wH_CItem.WHCI_CCode_IsChanged)
            {
                sbParameter.Append("WHCI_CCode=@WHCI_CCode, ");
            }
            if (wH_CItem.WHCI_MCode_IsChanged)
            {
                sbParameter.Append("WHCI_MCode=@WHCI_MCode, ");
            }
            if (wH_CItem.WHCI_Num_IsChanged)
            {
                sbParameter.Append("WHCI_Num=@WHCI_Num, ");
            }
            if (wH_CItem.WHCI_Unit_IsChanged)
            {
                sbParameter.Append("WHCI_Unit=@WHCI_Unit, ");
            }
            if (wH_CItem.WHCI_Manu_IsChanged)
            {
                sbParameter.Append("WHCI_Manu=@WHCI_Manu, ");
            }
            if (wH_CItem.WHCI_MDate_IsChanged)
            {
                sbParameter.Append("WHCI_MDate=@WHCI_MDate, ");
            }
            if (wH_CItem.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat, ");
            }
            if (wH_CItem.CreateDate_IsChanged)
            {
                sbParameter.Append("CreateDate=@CreateDate, ");
            }
            if (wH_CItem.UpdateDate_IsChanged)
            {
                sbParameter.Append("UpdateDate=@UpdateDate, ");
            }
            if (wH_CItem.DeleteDate_IsChanged)
            {
                sbParameter.Append("DeleteDate=@DeleteDate ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and WHCI_ID=@WHCI_ID; ");
            string sql = sb.ToString();

            if (wH_CItem.WHCI_CCode_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_CItem.WHCI_CCode))
                {
                    idb.AddParameter("@WHCI_CCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@WHCI_CCode", wH_CItem.WHCI_CCode);
                }
            }
            if (wH_CItem.WHCI_MCode_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_CItem.WHCI_MCode))
                {
                    idb.AddParameter("@WHCI_MCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@WHCI_MCode", wH_CItem.WHCI_MCode);
                }
            }
            if (wH_CItem.WHCI_Num_IsChanged)
            {
                if (wH_CItem.WHCI_Num == 0)
                {
                    idb.AddParameter("@WHCI_Num", 0);
                }
                else
                {
                    idb.AddParameter("@WHCI_Num", wH_CItem.WHCI_Num);
                }
            }
            if (wH_CItem.WHCI_Unit_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_CItem.WHCI_Unit))
                {
                    idb.AddParameter("@WHCI_Unit", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@WHCI_Unit", wH_CItem.WHCI_Unit);
                }
            }
            if (wH_CItem.WHCI_Manu_IsChanged)
            {
                if (string.IsNullOrEmpty(wH_CItem.WHCI_Manu))
                {
                    idb.AddParameter("@WHCI_Manu", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@WHCI_Manu", wH_CItem.WHCI_Manu);
                }
            }
            if (wH_CItem.WHCI_MDate_IsChanged)
            {
                if (wH_CItem.WHCI_MDate == DateTime.MinValue)
                {
                    idb.AddParameter("@WHCI_MDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@WHCI_MDate", wH_CItem.WHCI_MDate);
                }
            }
            if (wH_CItem.Stat_IsChanged)
            {
                if (wH_CItem.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", wH_CItem.Stat);
                }
            }
            if (wH_CItem.CreateDate_IsChanged)
            {
                if (wH_CItem.CreateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@CreateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@CreateDate", wH_CItem.CreateDate);
                }
            }
            if (wH_CItem.UpdateDate_IsChanged)
            {
                if (wH_CItem.UpdateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@UpdateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@UpdateDate", wH_CItem.UpdateDate);
                }
            }
            if (wH_CItem.DeleteDate_IsChanged)
            {
                if (wH_CItem.DeleteDate == DateTime.MinValue)
                {
                    idb.AddParameter("@DeleteDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@DeleteDate", wH_CItem.DeleteDate);
                }
            }

            idb.AddParameter("@WHCI_ID", wH_CItem.WHCI_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 12
0
        /// <summary>
        /// 添加备注信息 Bse_Bak对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Bse_Bak bse_Bak)
        {
            string sql = "INSERT INTO Bse_Bak (Module_Code,Record_ID,Bak_Content,Stat) VALUES (@Module_Code,@Record_ID,@Bak_Content,@Stat);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(bse_Bak.Module_Code))
            {
                idb.AddParameter("@Module_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Module_Code", bse_Bak.Module_Code);
            }
            if (string.IsNullOrEmpty(bse_Bak.Record_ID))
            {
                idb.AddParameter("@Record_ID", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Record_ID", bse_Bak.Record_ID);
            }
            if (string.IsNullOrEmpty(bse_Bak.Bak_Content))
            {
                idb.AddParameter("@Bak_Content", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Bak_Content", bse_Bak.Bak_Content);
            }
            if (bse_Bak.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", bse_Bak.Stat);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                var Return = idb.ReturnValue(sql);
                Ex = Return.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 13
0
        /// <summary>
        /// 更新备注信息 Bse_Bak对象(即:一条记录
        /// </summary>
        public int Update(Bse_Bak bse_Bak)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       Bse_Bak       SET ");
            if (bse_Bak.Module_Code_IsChanged)
            {
                sbParameter.Append("Module_Code=@Module_Code, ");
            }
            if (bse_Bak.Record_ID_IsChanged)
            {
                sbParameter.Append("Record_ID=@Record_ID, ");
            }
            if (bse_Bak.Bak_Content_IsChanged)
            {
                sbParameter.Append("Bak_Content=@Bak_Content, ");
            }
            if (bse_Bak.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and Bak_ID=@Bak_ID; ");
            string sql = sb.ToString();

            if (bse_Bak.Module_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Bak.Module_Code))
                {
                    idb.AddParameter("@Module_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Module_Code", bse_Bak.Module_Code);
                }
            }
            if (bse_Bak.Record_ID_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Bak.Record_ID))
                {
                    idb.AddParameter("@Record_ID", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Record_ID", bse_Bak.Record_ID);
                }
            }
            if (bse_Bak.Bak_Content_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Bak.Bak_Content))
                {
                    idb.AddParameter("@Bak_Content", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Bak_Content", bse_Bak.Bak_Content);
                }
            }
            if (bse_Bak.Stat_IsChanged)
            {
                if (bse_Bak.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", bse_Bak.Stat);
                }
            }

            idb.AddParameter("@Bak_ID", bse_Bak.Bak_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 14
0
        /// <summary>
        /// 添加PCD_Queue对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(PCD_Queue pCD_Queue)
        {
            string sql = "INSERT INTO PCD_Queue (PCDO_PlanCode,PCDO_NCode,PCDO_Order,Stat) VALUES (@PCDO_PlanCode,@PCDO_NCode,@PCDO_Order,@Stat);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(pCD_Queue.PCDO_PlanCode))
            {
                idb.AddParameter("@PCDO_PlanCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCDO_PlanCode", pCD_Queue.PCDO_PlanCode);
            }
            if (string.IsNullOrEmpty(pCD_Queue.PCDO_NCode))
            {
                idb.AddParameter("@PCDO_NCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCDO_NCode", pCD_Queue.PCDO_NCode);
            }
            if (pCD_Queue.PCDO_Order == 0)
            {
                idb.AddParameter("@PCDO_Order", 0);
            }
            else
            {
                idb.AddParameter("@PCDO_Order", pCD_Queue.PCDO_Order);
            }
            if (pCD_Queue.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", pCD_Queue.Stat);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                var Return = idb.ReturnValue(sql);
                Ex = Return.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 15
0
        /// <summary>
        /// 更新设备检修计划 Equ_MPlan对象(即:一条记录
        /// </summary>
        public int Update(Equ_MPlan equ_MPlan)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       Equ_MPlan       SET ");
            if (equ_MPlan.MP_Code_IsChanged)
            {
                sbParameter.Append("MP_Code=@MP_Code, ");
            }
            if (equ_MPlan.MP_Name_IsChanged)
            {
                sbParameter.Append("MP_Name=@MP_Name, ");
            }
            if (equ_MPlan.MP_Stuff_IsChanged)
            {
                sbParameter.Append("MP_Stuff=@MP_Stuff, ");
            }
            if (equ_MPlan.MP_Start_IsChanged)
            {
                sbParameter.Append("MP_Start=@MP_Start, ");
            }
            if (equ_MPlan.MP_End_IsChanged)
            {
                sbParameter.Append("MP_End=@MP_End, ");
            }
            if (equ_MPlan.VerifyStuff_IsChanged)
            {
                sbParameter.Append("VerifyStuff=@VerifyStuff, ");
            }
            if (equ_MPlan.VerifyStat_IsChanged)
            {
                sbParameter.Append("VerifyStat=@VerifyStat, ");
            }
            if (equ_MPlan.VerifyDate_IsChanged)
            {
                sbParameter.Append("VerifyDate=@VerifyDate, ");
            }
            if (equ_MPlan.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat, ");
            }
            if (equ_MPlan.MP_ECode_IsChanged)
            {
                sbParameter.Append("MP_ECode=@MP_ECode, ");
            }
            if (equ_MPlan.MP_EName_IsChanged)
            {
                sbParameter.Append("MP_EName=@MP_EName ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and MP_ID=@MP_ID; ");
            string sql = sb.ToString();

            if (equ_MPlan.MP_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(equ_MPlan.MP_Code))
                {
                    idb.AddParameter("@MP_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MP_Code", equ_MPlan.MP_Code);
                }
            }
            if (equ_MPlan.MP_Name_IsChanged)
            {
                if (string.IsNullOrEmpty(equ_MPlan.MP_Name))
                {
                    idb.AddParameter("@MP_Name", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MP_Name", equ_MPlan.MP_Name);
                }
            }
            if (equ_MPlan.MP_Stuff_IsChanged)
            {
                if (string.IsNullOrEmpty(equ_MPlan.MP_Stuff))
                {
                    idb.AddParameter("@MP_Stuff", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MP_Stuff", equ_MPlan.MP_Stuff);
                }
            }
            if (equ_MPlan.MP_Start_IsChanged)
            {
                if (equ_MPlan.MP_Start == DateTime.MinValue)
                {
                    idb.AddParameter("@MP_Start", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MP_Start", equ_MPlan.MP_Start);
                }
            }
            if (equ_MPlan.MP_End_IsChanged)
            {
                if (equ_MPlan.MP_End == DateTime.MinValue)
                {
                    idb.AddParameter("@MP_End", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MP_End", equ_MPlan.MP_End);
                }
            }
            if (equ_MPlan.VerifyStuff_IsChanged)
            {
                if (string.IsNullOrEmpty(equ_MPlan.VerifyStuff))
                {
                    idb.AddParameter("@VerifyStuff", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@VerifyStuff", equ_MPlan.VerifyStuff);
                }
            }
            if (equ_MPlan.VerifyStat_IsChanged)
            {
                if (string.IsNullOrEmpty(equ_MPlan.VerifyStat))
                {
                    idb.AddParameter("@VerifyStat", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@VerifyStat", equ_MPlan.VerifyStat);
                }
            }
            if (equ_MPlan.VerifyDate_IsChanged)
            {
                if (equ_MPlan.VerifyDate == DateTime.MinValue)
                {
                    idb.AddParameter("@VerifyDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@VerifyDate", equ_MPlan.VerifyDate);
                }
            }
            if (equ_MPlan.Stat_IsChanged)
            {
                if (equ_MPlan.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", equ_MPlan.Stat);
                }
            }
            if (equ_MPlan.MP_ECode_IsChanged)
            {
                if (string.IsNullOrEmpty(equ_MPlan.MP_ECode))
                {
                    idb.AddParameter("@MP_ECode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MP_ECode", equ_MPlan.MP_ECode);
                }
            }
            if (equ_MPlan.MP_EName_IsChanged)
            {
                if (string.IsNullOrEmpty(equ_MPlan.MP_EName))
                {
                    idb.AddParameter("@MP_EName", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@MP_EName", equ_MPlan.MP_EName);
                }
            }

            idb.AddParameter("@MP_ID", equ_MPlan.MP_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 16
0
        /// <summary>
        /// 添加Bug日志 Sys_BugLog对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Sys_BugLog sys_BugLog)
        {
            string sql = "INSERT INTO Sys_BugLog (SL_Code,SL_OpUser,SL_Date,SL_Status,SL_Owner,Stat) VALUES (@SL_Code,@SL_OpUser,@SL_Date,@SL_Status,@SL_Owner,@Stat);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(sys_BugLog.SL_Code))
            {
                idb.AddParameter("@SL_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SL_Code", sys_BugLog.SL_Code);
            }
            if (string.IsNullOrEmpty(sys_BugLog.SL_OpUser))
            {
                idb.AddParameter("@SL_OpUser", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SL_OpUser", sys_BugLog.SL_OpUser);
            }
            if (sys_BugLog.SL_Date == DateTime.MinValue)
            {
                idb.AddParameter("@SL_Date", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SL_Date", sys_BugLog.SL_Date);
            }
            if (string.IsNullOrEmpty(sys_BugLog.SL_Status))
            {
                idb.AddParameter("@SL_Status", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SL_Status", sys_BugLog.SL_Status);
            }
            if (string.IsNullOrEmpty(sys_BugLog.SL_Owner))
            {
                idb.AddParameter("@SL_Owner", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@SL_Owner", sys_BugLog.SL_Owner);
            }
            if (sys_BugLog.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", sys_BugLog.Stat);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                var Return = idb.ReturnValue(sql);
                Ex = Return.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 17
0
        /// <summary>
        /// 添加PC_WError对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(PC_WError pC_WError)
        {
            string sql = "INSERT INTO PC_WError (PCWE_Code,PCWE_Module,PCWE_WHCode,PCWE_WHName,PCWE_MCode,PCWE_MName,PCWE_Unit,PCWE_Num,PCWE_Operator,PCWE_OpDate,PCWE_Bak,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@PCWE_Code,@PCWE_Module,@PCWE_WHCode,@PCWE_WHName,@PCWE_MCode,@PCWE_MName,@PCWE_Unit,@PCWE_Num,@PCWE_Operator,@PCWE_OpDate,@PCWE_Bak,@Stat,@CreateDate,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(pC_WError.PCWE_Code))
            {
                idb.AddParameter("@PCWE_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_Code", pC_WError.PCWE_Code);
            }
            if (string.IsNullOrEmpty(pC_WError.PCWE_Module))
            {
                idb.AddParameter("@PCWE_Module", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_Module", pC_WError.PCWE_Module);
            }
            if (string.IsNullOrEmpty(pC_WError.PCWE_WHCode))
            {
                idb.AddParameter("@PCWE_WHCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_WHCode", pC_WError.PCWE_WHCode);
            }
            if (string.IsNullOrEmpty(pC_WError.PCWE_WHName))
            {
                idb.AddParameter("@PCWE_WHName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_WHName", pC_WError.PCWE_WHName);
            }
            if (string.IsNullOrEmpty(pC_WError.PCWE_MCode))
            {
                idb.AddParameter("@PCWE_MCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_MCode", pC_WError.PCWE_MCode);
            }
            if (string.IsNullOrEmpty(pC_WError.PCWE_MName))
            {
                idb.AddParameter("@PCWE_MName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_MName", pC_WError.PCWE_MName);
            }
            if (string.IsNullOrEmpty(pC_WError.PCWE_Unit))
            {
                idb.AddParameter("@PCWE_Unit", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_Unit", pC_WError.PCWE_Unit);
            }
            if (pC_WError.PCWE_Num == 0)
            {
                idb.AddParameter("@PCWE_Num", 0);
            }
            else
            {
                idb.AddParameter("@PCWE_Num", pC_WError.PCWE_Num);
            }
            if (string.IsNullOrEmpty(pC_WError.PCWE_Operator))
            {
                idb.AddParameter("@PCWE_Operator", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_Operator", pC_WError.PCWE_Operator);
            }
            if (pC_WError.PCWE_OpDate == DateTime.MinValue)
            {
                idb.AddParameter("@PCWE_OpDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_OpDate", pC_WError.PCWE_OpDate);
            }
            if (string.IsNullOrEmpty(pC_WError.PCWE_Bak))
            {
                idb.AddParameter("@PCWE_Bak", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCWE_Bak", pC_WError.PCWE_Bak);
            }
            if (pC_WError.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", pC_WError.Stat);
            }
            if (pC_WError.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", pC_WError.CreateDate);
            }
            if (pC_WError.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", pC_WError.UpdateDate);
            }
            if (pC_WError.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", pC_WError.DeleteDate);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                var Return = idb.ReturnValue(sql);
                Ex = Return.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 18
0
        /// <summary>
        /// 添加车辆事件表 PCT_Event对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(PCT_Event pCT_Event)
        {
            string sql = "INSERT INTO PCT_Event (PCTE_Code,PCTE_CCode,PCTE_CNo,PCTE_Description,PCTE_BeginDate,PCTE_EndDate,PCTE_EventType,PCTE_DCode,PCTE_Join,PCTE_Cost,PCTE_Before,PCTE_After,PCTE_Address,Stat,CreateDate,UpdateDate,DeleteDate,PCTE_iType,PCTE_TCode,PCTE_Udef2,PCTE_Udef3,PCTE_Udef4,PCTE_Udef5) VALUES (@PCTE_Code,@PCTE_CCode,@PCTE_CNo,@PCTE_Description,@PCTE_BeginDate,@PCTE_EndDate,@PCTE_EventType,@PCTE_DCode,@PCTE_Join,@PCTE_Cost,@PCTE_Before,@PCTE_After,@PCTE_Address,@Stat,@CreateDate,@UpdateDate,@DeleteDate,@PCTE_iType,@PCTE_TCode,@PCTE_Udef2,@PCTE_Udef3,@PCTE_Udef4,@PCTE_Udef5);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(pCT_Event.PCTE_Code))
            {
                idb.AddParameter("@PCTE_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Code", pCT_Event.PCTE_Code);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_CCode))
            {
                idb.AddParameter("@PCTE_CCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_CCode", pCT_Event.PCTE_CCode);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_CNo))
            {
                idb.AddParameter("@PCTE_CNo", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_CNo", pCT_Event.PCTE_CNo);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Description))
            {
                idb.AddParameter("@PCTE_Description", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Description", pCT_Event.PCTE_Description);
            }
            if (pCT_Event.PCTE_BeginDate == DateTime.MinValue)
            {
                idb.AddParameter("@PCTE_BeginDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_BeginDate", pCT_Event.PCTE_BeginDate);
            }
            if (pCT_Event.PCTE_EndDate == DateTime.MinValue)
            {
                idb.AddParameter("@PCTE_EndDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_EndDate", pCT_Event.PCTE_EndDate);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_EventType))
            {
                idb.AddParameter("@PCTE_EventType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_EventType", pCT_Event.PCTE_EventType);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_DCode))
            {
                idb.AddParameter("@PCTE_DCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_DCode", pCT_Event.PCTE_DCode);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Join))
            {
                idb.AddParameter("@PCTE_Join", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Join", pCT_Event.PCTE_Join);
            }
            if (pCT_Event.PCTE_Cost == 0)
            {
                idb.AddParameter("@PCTE_Cost", 0);
            }
            else
            {
                idb.AddParameter("@PCTE_Cost", pCT_Event.PCTE_Cost);
            }
            if (pCT_Event.PCTE_Before == 0)
            {
                idb.AddParameter("@PCTE_Before", 0);
            }
            else
            {
                idb.AddParameter("@PCTE_Before", pCT_Event.PCTE_Before);
            }
            if (pCT_Event.PCTE_After == 0)
            {
                idb.AddParameter("@PCTE_After", 0);
            }
            else
            {
                idb.AddParameter("@PCTE_After", pCT_Event.PCTE_After);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Address))
            {
                idb.AddParameter("@PCTE_Address", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Address", pCT_Event.PCTE_Address);
            }
            if (pCT_Event.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", pCT_Event.Stat);
            }
            if (pCT_Event.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", pCT_Event.CreateDate);
            }
            if (pCT_Event.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", pCT_Event.UpdateDate);
            }
            if (pCT_Event.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", pCT_Event.DeleteDate);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_iType))
            {
                idb.AddParameter("@PCTE_iType", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_iType", pCT_Event.PCTE_iType);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_TCode))
            {
                idb.AddParameter("@PCTE_TCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_TCode", pCT_Event.PCTE_TCode);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef2))
            {
                idb.AddParameter("@PCTE_Udef2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Udef2", pCT_Event.PCTE_Udef2);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef3))
            {
                idb.AddParameter("@PCTE_Udef3", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Udef3", pCT_Event.PCTE_Udef3);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef4))
            {
                idb.AddParameter("@PCTE_Udef4", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Udef4", pCT_Event.PCTE_Udef4);
            }
            if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef5))
            {
                idb.AddParameter("@PCTE_Udef5", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCTE_Udef5", pCT_Event.PCTE_Udef5);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                var Return = idb.ReturnValue(sql);
                Ex = Return.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 19
0
        /// <summary>
        /// 更新Bug管理系统 Sys_Bug对象(即:一条记录
        /// </summary>
        public int Update(Sys_Bug sys_Bug)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       Sys_Bug       SET ");
            if (sys_Bug.Sys_Code_IsChanged)
            {
                sbParameter.Append("Sys_Code=@Sys_Code, ");
            }
            if (sys_Bug.Sys_Date_IsChanged)
            {
                sbParameter.Append("Sys_Date=@Sys_Date, ");
            }
            if (sys_Bug.Sys_Title_IsChanged)
            {
                sbParameter.Append("Sys_Title=@Sys_Title, ");
            }
            if (sys_Bug.Sys_Des_IsChanged)
            {
                sbParameter.Append("Sys_Des=@Sys_Des, ");
            }
            if (sys_Bug.Sys_Project_IsChanged)
            {
                sbParameter.Append("Sys_Project=@Sys_Project, ");
            }
            if (sys_Bug.Sys_Module_IsChanged)
            {
                sbParameter.Append("Sys_Module=@Sys_Module, ");
            }
            if (sys_Bug.Sys_UserCode_IsChanged)
            {
                sbParameter.Append("Sys_UserCode=@Sys_UserCode, ");
            }
            if (sys_Bug.Sys_UserName_IsChanged)
            {
                sbParameter.Append("Sys_UserName=@Sys_UserName, ");
            }
            if (sys_Bug.Sys_Owner_IsChanged)
            {
                sbParameter.Append("Sys_Owner=@Sys_Owner, ");
            }
            if (sys_Bug.Sys_OpUser_IsChanged)
            {
                sbParameter.Append("Sys_OpUser=@Sys_OpUser, ");
            }
            if (sys_Bug.Sys_Status_IsChanged)
            {
                sbParameter.Append("Sys_Status=@Sys_Status, ");
            }
            if (sys_Bug.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and Sys_ID=@Sys_ID; ");
            string sql = sb.ToString();

            if (sys_Bug.Sys_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_Code))
                {
                    idb.AddParameter("@Sys_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_Code", sys_Bug.Sys_Code);
                }
            }
            if (sys_Bug.Sys_Date_IsChanged)
            {
                if (sys_Bug.Sys_Date == DateTime.MinValue)
                {
                    idb.AddParameter("@Sys_Date", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_Date", sys_Bug.Sys_Date);
                }
            }
            if (sys_Bug.Sys_Title_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_Title))
                {
                    idb.AddParameter("@Sys_Title", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_Title", sys_Bug.Sys_Title);
                }
            }
            if (sys_Bug.Sys_Des_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_Des))
                {
                    idb.AddParameter("@Sys_Des", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_Des", sys_Bug.Sys_Des);
                }
            }
            if (sys_Bug.Sys_Project_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_Project))
                {
                    idb.AddParameter("@Sys_Project", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_Project", sys_Bug.Sys_Project);
                }
            }
            if (sys_Bug.Sys_Module_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_Module))
                {
                    idb.AddParameter("@Sys_Module", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_Module", sys_Bug.Sys_Module);
                }
            }
            if (sys_Bug.Sys_UserCode_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_UserCode))
                {
                    idb.AddParameter("@Sys_UserCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_UserCode", sys_Bug.Sys_UserCode);
                }
            }
            if (sys_Bug.Sys_UserName_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_UserName))
                {
                    idb.AddParameter("@Sys_UserName", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_UserName", sys_Bug.Sys_UserName);
                }
            }
            if (sys_Bug.Sys_Owner_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_Owner))
                {
                    idb.AddParameter("@Sys_Owner", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_Owner", sys_Bug.Sys_Owner);
                }
            }
            if (sys_Bug.Sys_OpUser_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_OpUser))
                {
                    idb.AddParameter("@Sys_OpUser", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_OpUser", sys_Bug.Sys_OpUser);
                }
            }
            if (sys_Bug.Sys_Status_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_Bug.Sys_Status))
                {
                    idb.AddParameter("@Sys_Status", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Sys_Status", sys_Bug.Sys_Status);
                }
            }
            if (sys_Bug.Stat_IsChanged)
            {
                if (sys_Bug.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", sys_Bug.Stat);
                }
            }

            idb.AddParameter("@Sys_ID", sys_Bug.Sys_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 20
0
        /// <summary>
        /// 更新车辆事件表 PCT_Event对象(即:一条记录
        /// </summary>
        public int Update(PCT_Event pCT_Event)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       PCT_Event       SET ");
            if (pCT_Event.PCTE_Code_IsChanged)
            {
                sbParameter.Append("PCTE_Code=@PCTE_Code, ");
            }
            if (pCT_Event.PCTE_CCode_IsChanged)
            {
                sbParameter.Append("PCTE_CCode=@PCTE_CCode, ");
            }
            if (pCT_Event.PCTE_CNo_IsChanged)
            {
                sbParameter.Append("PCTE_CNo=@PCTE_CNo, ");
            }
            if (pCT_Event.PCTE_Description_IsChanged)
            {
                sbParameter.Append("PCTE_Description=@PCTE_Description, ");
            }
            if (pCT_Event.PCTE_BeginDate_IsChanged)
            {
                sbParameter.Append("PCTE_BeginDate=@PCTE_BeginDate, ");
            }
            if (pCT_Event.PCTE_EndDate_IsChanged)
            {
                sbParameter.Append("PCTE_EndDate=@PCTE_EndDate, ");
            }
            if (pCT_Event.PCTE_EventType_IsChanged)
            {
                sbParameter.Append("PCTE_EventType=@PCTE_EventType, ");
            }
            if (pCT_Event.PCTE_DCode_IsChanged)
            {
                sbParameter.Append("PCTE_DCode=@PCTE_DCode, ");
            }
            if (pCT_Event.PCTE_Join_IsChanged)
            {
                sbParameter.Append("PCTE_Join=@PCTE_Join, ");
            }
            if (pCT_Event.PCTE_Cost_IsChanged)
            {
                sbParameter.Append("PCTE_Cost=@PCTE_Cost, ");
            }
            if (pCT_Event.PCTE_Before_IsChanged)
            {
                sbParameter.Append("PCTE_Before=@PCTE_Before, ");
            }
            if (pCT_Event.PCTE_After_IsChanged)
            {
                sbParameter.Append("PCTE_After=@PCTE_After, ");
            }
            if (pCT_Event.PCTE_Address_IsChanged)
            {
                sbParameter.Append("PCTE_Address=@PCTE_Address, ");
            }
            if (pCT_Event.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat, ");
            }
            if (pCT_Event.CreateDate_IsChanged)
            {
                sbParameter.Append("CreateDate=@CreateDate, ");
            }
            if (pCT_Event.UpdateDate_IsChanged)
            {
                sbParameter.Append("UpdateDate=@UpdateDate, ");
            }
            if (pCT_Event.DeleteDate_IsChanged)
            {
                sbParameter.Append("DeleteDate=@DeleteDate, ");
            }
            if (pCT_Event.PCTE_iType_IsChanged)
            {
                sbParameter.Append("PCTE_iType=@PCTE_iType, ");
            }
            if (pCT_Event.PCTE_TCode_IsChanged)
            {
                sbParameter.Append("PCTE_TCode=@PCTE_TCode, ");
            }
            if (pCT_Event.PCTE_Udef2_IsChanged)
            {
                sbParameter.Append("PCTE_Udef2=@PCTE_Udef2, ");
            }
            if (pCT_Event.PCTE_Udef3_IsChanged)
            {
                sbParameter.Append("PCTE_Udef3=@PCTE_Udef3, ");
            }
            if (pCT_Event.PCTE_Udef4_IsChanged)
            {
                sbParameter.Append("PCTE_Udef4=@PCTE_Udef4, ");
            }
            if (pCT_Event.PCTE_Udef5_IsChanged)
            {
                sbParameter.Append("PCTE_Udef5=@PCTE_Udef5 ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and PCTE_ID=@PCTE_ID; ");
            string sql = sb.ToString();

            if (pCT_Event.PCTE_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_Code))
                {
                    idb.AddParameter("@PCTE_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_Code", pCT_Event.PCTE_Code);
                }
            }
            if (pCT_Event.PCTE_CCode_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_CCode))
                {
                    idb.AddParameter("@PCTE_CCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_CCode", pCT_Event.PCTE_CCode);
                }
            }
            if (pCT_Event.PCTE_CNo_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_CNo))
                {
                    idb.AddParameter("@PCTE_CNo", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_CNo", pCT_Event.PCTE_CNo);
                }
            }
            if (pCT_Event.PCTE_Description_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_Description))
                {
                    idb.AddParameter("@PCTE_Description", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_Description", pCT_Event.PCTE_Description);
                }
            }
            if (pCT_Event.PCTE_BeginDate_IsChanged)
            {
                if (pCT_Event.PCTE_BeginDate == DateTime.MinValue)
                {
                    idb.AddParameter("@PCTE_BeginDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_BeginDate", pCT_Event.PCTE_BeginDate);
                }
            }
            if (pCT_Event.PCTE_EndDate_IsChanged)
            {
                if (pCT_Event.PCTE_EndDate == DateTime.MinValue)
                {
                    idb.AddParameter("@PCTE_EndDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_EndDate", pCT_Event.PCTE_EndDate);
                }
            }
            if (pCT_Event.PCTE_EventType_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_EventType))
                {
                    idb.AddParameter("@PCTE_EventType", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_EventType", pCT_Event.PCTE_EventType);
                }
            }
            if (pCT_Event.PCTE_DCode_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_DCode))
                {
                    idb.AddParameter("@PCTE_DCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_DCode", pCT_Event.PCTE_DCode);
                }
            }
            if (pCT_Event.PCTE_Join_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_Join))
                {
                    idb.AddParameter("@PCTE_Join", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_Join", pCT_Event.PCTE_Join);
                }
            }
            if (pCT_Event.PCTE_Cost_IsChanged)
            {
                if (pCT_Event.PCTE_Cost == 0)
                {
                    idb.AddParameter("@PCTE_Cost", 0);
                }
                else
                {
                    idb.AddParameter("@PCTE_Cost", pCT_Event.PCTE_Cost);
                }
            }
            if (pCT_Event.PCTE_Before_IsChanged)
            {
                if (pCT_Event.PCTE_Before == 0)
                {
                    idb.AddParameter("@PCTE_Before", 0);
                }
                else
                {
                    idb.AddParameter("@PCTE_Before", pCT_Event.PCTE_Before);
                }
            }
            if (pCT_Event.PCTE_After_IsChanged)
            {
                if (pCT_Event.PCTE_After == 0)
                {
                    idb.AddParameter("@PCTE_After", 0);
                }
                else
                {
                    idb.AddParameter("@PCTE_After", pCT_Event.PCTE_After);
                }
            }
            if (pCT_Event.PCTE_Address_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_Address))
                {
                    idb.AddParameter("@PCTE_Address", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_Address", pCT_Event.PCTE_Address);
                }
            }
            if (pCT_Event.Stat_IsChanged)
            {
                if (pCT_Event.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", pCT_Event.Stat);
                }
            }
            if (pCT_Event.CreateDate_IsChanged)
            {
                if (pCT_Event.CreateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@CreateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@CreateDate", pCT_Event.CreateDate);
                }
            }
            if (pCT_Event.UpdateDate_IsChanged)
            {
                if (pCT_Event.UpdateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@UpdateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@UpdateDate", pCT_Event.UpdateDate);
                }
            }
            if (pCT_Event.DeleteDate_IsChanged)
            {
                if (pCT_Event.DeleteDate == DateTime.MinValue)
                {
                    idb.AddParameter("@DeleteDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@DeleteDate", pCT_Event.DeleteDate);
                }
            }
            if (pCT_Event.PCTE_iType_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_iType))
                {
                    idb.AddParameter("@PCTE_iType", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_iType", pCT_Event.PCTE_iType);
                }
            }
            if (pCT_Event.PCTE_TCode_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_TCode))
                {
                    idb.AddParameter("@PCTE_TCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_TCode", pCT_Event.PCTE_TCode);
                }
            }
            if (pCT_Event.PCTE_Udef2_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef2))
                {
                    idb.AddParameter("@PCTE_Udef2", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_Udef2", pCT_Event.PCTE_Udef2);
                }
            }
            if (pCT_Event.PCTE_Udef3_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef3))
                {
                    idb.AddParameter("@PCTE_Udef3", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_Udef3", pCT_Event.PCTE_Udef3);
                }
            }
            if (pCT_Event.PCTE_Udef4_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef4))
                {
                    idb.AddParameter("@PCTE_Udef4", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_Udef4", pCT_Event.PCTE_Udef4);
                }
            }
            if (pCT_Event.PCTE_Udef5_IsChanged)
            {
                if (string.IsNullOrEmpty(pCT_Event.PCTE_Udef5))
                {
                    idb.AddParameter("@PCTE_Udef5", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@PCTE_Udef5", pCT_Event.PCTE_Udef5);
                }
            }

            idb.AddParameter("@PCTE_ID", pCT_Event.PCTE_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 21
0
        /// <summary>
        /// 添加公司物料类别 WH_MaterialType对象(即:一条记录)
        /// </summary>
        public int Add(WH_MaterialType wH_MaterialType)
        {
            string sql = "INSERT INTO WH_MaterialType (MT_Code,MT_TCode,MT_TName,MT_Company,MT_CompanyCode,MT_Dept,MT_DeptCode,Stat,MT_Status,CreateDate,UpdateDate,DeleteDate,MT_Itype,MT_Type,MT_Employee,MT_EmployeeName,MT_TPCode,MT_Order) VALUES (@MT_Code,@MT_TCode,@MT_TName,@MT_Company,@MT_CompanyCode,@MT_Dept,@MT_DeptCode,@Stat,@MT_Status,@CreateDate,@UpdateDate,@DeleteDate,@MT_Itype,@MT_Type,@MT_Employee,@MT_EmployeeName,@MT_TPCode,@MT_Order)";

            if (string.IsNullOrEmpty(wH_MaterialType.MT_Code))
            {
                idb.AddParameter("@MT_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Code", wH_MaterialType.MT_Code);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_TCode))
            {
                idb.AddParameter("@MT_TCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_TCode", wH_MaterialType.MT_TCode);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_TName))
            {
                idb.AddParameter("@MT_TName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_TName", wH_MaterialType.MT_TName);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Company))
            {
                idb.AddParameter("@MT_Company", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Company", wH_MaterialType.MT_Company);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_CompanyCode))
            {
                idb.AddParameter("@MT_CompanyCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_CompanyCode", wH_MaterialType.MT_CompanyCode);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Dept))
            {
                idb.AddParameter("@MT_Dept", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Dept", wH_MaterialType.MT_Dept);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_DeptCode))
            {
                idb.AddParameter("@MT_DeptCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_DeptCode", wH_MaterialType.MT_DeptCode);
            }
            if (wH_MaterialType.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", wH_MaterialType.Stat);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Status))
            {
                idb.AddParameter("@MT_Status", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Status", wH_MaterialType.MT_Status);
            }
            if (wH_MaterialType.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", wH_MaterialType.CreateDate);
            }
            if (wH_MaterialType.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", wH_MaterialType.UpdateDate);
            }
            if (wH_MaterialType.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", wH_MaterialType.DeleteDate);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Itype))
            {
                idb.AddParameter("@MT_Itype", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Itype", wH_MaterialType.MT_Itype);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Type))
            {
                idb.AddParameter("@MT_Type", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Type", wH_MaterialType.MT_Type);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_Employee))
            {
                idb.AddParameter("@MT_Employee", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_Employee", wH_MaterialType.MT_Employee);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_EmployeeName))
            {
                idb.AddParameter("@MT_EmployeeName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_EmployeeName", wH_MaterialType.MT_EmployeeName);
            }
            if (string.IsNullOrEmpty(wH_MaterialType.MT_TPCode))
            {
                idb.AddParameter("@MT_TPCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MT_TPCode", wH_MaterialType.MT_TPCode);
            }
            if (wH_MaterialType.MT_Order == 0)
            {
                idb.AddParameter("@MT_Order", 0);
            }
            else
            {
                idb.AddParameter("@MT_Order", wH_MaterialType.MT_Order);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 22
0
        /// <summary>
        /// 添加联系人信息 Bse_Contacts对象(即:一条记录)
        /// </summary>
        public object AddWithReturn(Bse_Contacts bse_Contacts)
        {
            string sql = "INSERT INTO Bse_Contacts (Module_Code,Record_ID,BContact_Name,BContact_Tel1,BContact_Tel2,BContact_Fax,BContact_Addr,BContact_Email,BContact_Duty,BContact_Gender,BContact_Career,BContact_Birth,BContact_From,BContact_IsDefault,CreateDate,Creator,BContact_Bak1,BContact_Bak2,Stat,BContact_Code,UpdateDate,DeleteDate) VALUES (@Module_Code,@Record_ID,@BContact_Name,@BContact_Tel1,@BContact_Tel2,@BContact_Fax,@BContact_Addr,@BContact_Email,@BContact_Duty,@BContact_Gender,@BContact_Career,@BContact_Birth,@BContact_From,@BContact_IsDefault,@CreateDate,@Creator,@BContact_Bak1,@BContact_Bak2,@Stat,@BContact_Code,@UpdateDate,@DeleteDate);SELECT @@IDENTITY AS ReturnID;";

            if (string.IsNullOrEmpty(bse_Contacts.Module_Code))
            {
                idb.AddParameter("@Module_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Module_Code", bse_Contacts.Module_Code);
            }
            if (string.IsNullOrEmpty(bse_Contacts.Record_ID))
            {
                idb.AddParameter("@Record_ID", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Record_ID", bse_Contacts.Record_ID);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Name))
            {
                idb.AddParameter("@BContact_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Name", bse_Contacts.BContact_Name);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Tel1))
            {
                idb.AddParameter("@BContact_Tel1", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Tel1", bse_Contacts.BContact_Tel1);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Tel2))
            {
                idb.AddParameter("@BContact_Tel2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Tel2", bse_Contacts.BContact_Tel2);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Fax))
            {
                idb.AddParameter("@BContact_Fax", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Fax", bse_Contacts.BContact_Fax);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Addr))
            {
                idb.AddParameter("@BContact_Addr", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Addr", bse_Contacts.BContact_Addr);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Email))
            {
                idb.AddParameter("@BContact_Email", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Email", bse_Contacts.BContact_Email);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Duty))
            {
                idb.AddParameter("@BContact_Duty", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Duty", bse_Contacts.BContact_Duty);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Gender))
            {
                idb.AddParameter("@BContact_Gender", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Gender", bse_Contacts.BContact_Gender);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Career))
            {
                idb.AddParameter("@BContact_Career", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Career", bse_Contacts.BContact_Career);
            }
            if (bse_Contacts.BContact_Birth == DateTime.MinValue)
            {
                idb.AddParameter("@BContact_Birth", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Birth", bse_Contacts.BContact_Birth);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_From))
            {
                idb.AddParameter("@BContact_From", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_From", bse_Contacts.BContact_From);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_IsDefault))
            {
                idb.AddParameter("@BContact_IsDefault", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_IsDefault", bse_Contacts.BContact_IsDefault);
            }
            if (bse_Contacts.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", bse_Contacts.CreateDate);
            }
            if (string.IsNullOrEmpty(bse_Contacts.Creator))
            {
                idb.AddParameter("@Creator", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@Creator", bse_Contacts.Creator);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Bak1))
            {
                idb.AddParameter("@BContact_Bak1", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Bak1", bse_Contacts.BContact_Bak1);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Bak2))
            {
                idb.AddParameter("@BContact_Bak2", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Bak2", bse_Contacts.BContact_Bak2);
            }
            if (bse_Contacts.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", bse_Contacts.Stat);
            }
            if (string.IsNullOrEmpty(bse_Contacts.BContact_Code))
            {
                idb.AddParameter("@BContact_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@BContact_Code", bse_Contacts.BContact_Code);
            }
            if (bse_Contacts.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", bse_Contacts.UpdateDate);
            }
            if (bse_Contacts.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", bse_Contacts.DeleteDate);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                var Return = idb.ReturnValue(sql);
                Ex = Return.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 23
0
        /// <summary>
        /// 添加搅拌站信息 PC_BStation对象(即:一条记录)
        /// </summary>
        public int Add(PC_BStation pC_BStation)
        {
            string sql = "INSERT INTO PC_BStation (PCBS_Code,PCBS_Name,PCBS_Addr,PCBS_Start,PCBS_Status,PCBS_Bak,Stat,CreateDate,UpdateDate,DeleteDate) VALUES (@PCBS_Code,@PCBS_Name,@PCBS_Addr,@PCBS_Start,@PCBS_Status,@PCBS_Bak,@Stat,@CreateDate,@UpdateDate,@DeleteDate)";

            if (string.IsNullOrEmpty(pC_BStation.PCBS_Code))
            {
                idb.AddParameter("@PCBS_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Code", pC_BStation.PCBS_Code);
            }
            if (string.IsNullOrEmpty(pC_BStation.PCBS_Name))
            {
                idb.AddParameter("@PCBS_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Name", pC_BStation.PCBS_Name);
            }
            if (string.IsNullOrEmpty(pC_BStation.PCBS_Addr))
            {
                idb.AddParameter("@PCBS_Addr", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Addr", pC_BStation.PCBS_Addr);
            }
            if (pC_BStation.PCBS_Start == DateTime.MinValue)
            {
                idb.AddParameter("@PCBS_Start", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Start", pC_BStation.PCBS_Start);
            }
            if (string.IsNullOrEmpty(pC_BStation.PCBS_Status))
            {
                idb.AddParameter("@PCBS_Status", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Status", pC_BStation.PCBS_Status);
            }
            if (string.IsNullOrEmpty(pC_BStation.PCBS_Bak))
            {
                idb.AddParameter("@PCBS_Bak", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@PCBS_Bak", pC_BStation.PCBS_Bak);
            }
            if (pC_BStation.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", pC_BStation.Stat);
            }
            if (pC_BStation.CreateDate == DateTime.MinValue)
            {
                idb.AddParameter("@CreateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@CreateDate", pC_BStation.CreateDate);
            }
            if (pC_BStation.UpdateDate == DateTime.MinValue)
            {
                idb.AddParameter("@UpdateDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@UpdateDate", pC_BStation.UpdateDate);
            }
            if (pC_BStation.DeleteDate == DateTime.MinValue)
            {
                idb.AddParameter("@DeleteDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@DeleteDate", pC_BStation.DeleteDate);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 24
0
        /// <summary>
        /// 更新联系人信息 Bse_Contacts对象(即:一条记录
        /// </summary>
        public int Update(Bse_Contacts bse_Contacts)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       Bse_Contacts       SET ");
            if (bse_Contacts.Module_Code_IsChanged)
            {
                sbParameter.Append("Module_Code=@Module_Code, ");
            }
            if (bse_Contacts.Record_ID_IsChanged)
            {
                sbParameter.Append("Record_ID=@Record_ID, ");
            }
            if (bse_Contacts.BContact_Name_IsChanged)
            {
                sbParameter.Append("BContact_Name=@BContact_Name, ");
            }
            if (bse_Contacts.BContact_Tel1_IsChanged)
            {
                sbParameter.Append("BContact_Tel1=@BContact_Tel1, ");
            }
            if (bse_Contacts.BContact_Tel2_IsChanged)
            {
                sbParameter.Append("BContact_Tel2=@BContact_Tel2, ");
            }
            if (bse_Contacts.BContact_Fax_IsChanged)
            {
                sbParameter.Append("BContact_Fax=@BContact_Fax, ");
            }
            if (bse_Contacts.BContact_Addr_IsChanged)
            {
                sbParameter.Append("BContact_Addr=@BContact_Addr, ");
            }
            if (bse_Contacts.BContact_Email_IsChanged)
            {
                sbParameter.Append("BContact_Email=@BContact_Email, ");
            }
            if (bse_Contacts.BContact_Duty_IsChanged)
            {
                sbParameter.Append("BContact_Duty=@BContact_Duty, ");
            }
            if (bse_Contacts.BContact_Gender_IsChanged)
            {
                sbParameter.Append("BContact_Gender=@BContact_Gender, ");
            }
            if (bse_Contacts.BContact_Career_IsChanged)
            {
                sbParameter.Append("BContact_Career=@BContact_Career, ");
            }
            if (bse_Contacts.BContact_Birth_IsChanged)
            {
                sbParameter.Append("BContact_Birth=@BContact_Birth, ");
            }
            if (bse_Contacts.BContact_From_IsChanged)
            {
                sbParameter.Append("BContact_From=@BContact_From, ");
            }
            if (bse_Contacts.BContact_IsDefault_IsChanged)
            {
                sbParameter.Append("BContact_IsDefault=@BContact_IsDefault, ");
            }
            if (bse_Contacts.CreateDate_IsChanged)
            {
                sbParameter.Append("CreateDate=@CreateDate, ");
            }
            if (bse_Contacts.Creator_IsChanged)
            {
                sbParameter.Append("Creator=@Creator, ");
            }
            if (bse_Contacts.BContact_Bak1_IsChanged)
            {
                sbParameter.Append("BContact_Bak1=@BContact_Bak1, ");
            }
            if (bse_Contacts.BContact_Bak2_IsChanged)
            {
                sbParameter.Append("BContact_Bak2=@BContact_Bak2, ");
            }
            if (bse_Contacts.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat, ");
            }
            if (bse_Contacts.BContact_Code_IsChanged)
            {
                sbParameter.Append("BContact_Code=@BContact_Code, ");
            }
            if (bse_Contacts.UpdateDate_IsChanged)
            {
                sbParameter.Append("UpdateDate=@UpdateDate, ");
            }
            if (bse_Contacts.DeleteDate_IsChanged)
            {
                sbParameter.Append("DeleteDate=@DeleteDate ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and BContact_ID=@BContact_ID; ");
            string sql = sb.ToString();

            if (bse_Contacts.Module_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.Module_Code))
                {
                    idb.AddParameter("@Module_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Module_Code", bse_Contacts.Module_Code);
                }
            }
            if (bse_Contacts.Record_ID_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.Record_ID))
                {
                    idb.AddParameter("@Record_ID", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Record_ID", bse_Contacts.Record_ID);
                }
            }
            if (bse_Contacts.BContact_Name_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Name))
                {
                    idb.AddParameter("@BContact_Name", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Name", bse_Contacts.BContact_Name);
                }
            }
            if (bse_Contacts.BContact_Tel1_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Tel1))
                {
                    idb.AddParameter("@BContact_Tel1", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Tel1", bse_Contacts.BContact_Tel1);
                }
            }
            if (bse_Contacts.BContact_Tel2_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Tel2))
                {
                    idb.AddParameter("@BContact_Tel2", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Tel2", bse_Contacts.BContact_Tel2);
                }
            }
            if (bse_Contacts.BContact_Fax_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Fax))
                {
                    idb.AddParameter("@BContact_Fax", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Fax", bse_Contacts.BContact_Fax);
                }
            }
            if (bse_Contacts.BContact_Addr_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Addr))
                {
                    idb.AddParameter("@BContact_Addr", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Addr", bse_Contacts.BContact_Addr);
                }
            }
            if (bse_Contacts.BContact_Email_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Email))
                {
                    idb.AddParameter("@BContact_Email", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Email", bse_Contacts.BContact_Email);
                }
            }
            if (bse_Contacts.BContact_Duty_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Duty))
                {
                    idb.AddParameter("@BContact_Duty", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Duty", bse_Contacts.BContact_Duty);
                }
            }
            if (bse_Contacts.BContact_Gender_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Gender))
                {
                    idb.AddParameter("@BContact_Gender", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Gender", bse_Contacts.BContact_Gender);
                }
            }
            if (bse_Contacts.BContact_Career_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Career))
                {
                    idb.AddParameter("@BContact_Career", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Career", bse_Contacts.BContact_Career);
                }
            }
            if (bse_Contacts.BContact_Birth_IsChanged)
            {
                if (bse_Contacts.BContact_Birth == DateTime.MinValue)
                {
                    idb.AddParameter("@BContact_Birth", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Birth", bse_Contacts.BContact_Birth);
                }
            }
            if (bse_Contacts.BContact_From_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_From))
                {
                    idb.AddParameter("@BContact_From", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_From", bse_Contacts.BContact_From);
                }
            }
            if (bse_Contacts.BContact_IsDefault_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_IsDefault))
                {
                    idb.AddParameter("@BContact_IsDefault", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_IsDefault", bse_Contacts.BContact_IsDefault);
                }
            }
            if (bse_Contacts.CreateDate_IsChanged)
            {
                if (bse_Contacts.CreateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@CreateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@CreateDate", bse_Contacts.CreateDate);
                }
            }
            if (bse_Contacts.Creator_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.Creator))
                {
                    idb.AddParameter("@Creator", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Creator", bse_Contacts.Creator);
                }
            }
            if (bse_Contacts.BContact_Bak1_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Bak1))
                {
                    idb.AddParameter("@BContact_Bak1", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Bak1", bse_Contacts.BContact_Bak1);
                }
            }
            if (bse_Contacts.BContact_Bak2_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Bak2))
                {
                    idb.AddParameter("@BContact_Bak2", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Bak2", bse_Contacts.BContact_Bak2);
                }
            }
            if (bse_Contacts.Stat_IsChanged)
            {
                if (bse_Contacts.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", bse_Contacts.Stat);
                }
            }
            if (bse_Contacts.BContact_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(bse_Contacts.BContact_Code))
                {
                    idb.AddParameter("@BContact_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@BContact_Code", bse_Contacts.BContact_Code);
                }
            }
            if (bse_Contacts.UpdateDate_IsChanged)
            {
                if (bse_Contacts.UpdateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@UpdateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@UpdateDate", bse_Contacts.UpdateDate);
                }
            }
            if (bse_Contacts.DeleteDate_IsChanged)
            {
                if (bse_Contacts.DeleteDate == DateTime.MinValue)
                {
                    idb.AddParameter("@DeleteDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@DeleteDate", bse_Contacts.DeleteDate);
                }
            }

            idb.AddParameter("@BContact_ID", bse_Contacts.BContact_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 25
0
        /// <summary>
        /// 更新审核阶段信息 Verify_Nodes对象(即:一条记录
        /// </summary>
        public int Update(Verify_Nodes verify_Nodes)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       Verify_Nodes       SET ");
            if (verify_Nodes.VerifyNode_Code_IsChanged)
            {
                sbParameter.Append("VerifyNode_Code=@VerifyNode_Code, ");
            }
            if (verify_Nodes.VerifyNode_Name_IsChanged)
            {
                sbParameter.Append("VerifyNode_Name=@VerifyNode_Name, ");
            }
            if (verify_Nodes.VerifyNode_Remark_IsChanged)
            {
                sbParameter.Append("VerifyNode_Remark=@VerifyNode_Remark, ");
            }
            if (verify_Nodes.VerifyNode_AuditNum_IsChanged)
            {
                sbParameter.Append("VerifyNode_AuditNum=@VerifyNode_AuditNum, ");
            }
            if (verify_Nodes.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and VerifyNode_ID=@VerifyNode_ID; ");
            string sql = sb.ToString();

            if (verify_Nodes.VerifyNode_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(verify_Nodes.VerifyNode_Code))
                {
                    idb.AddParameter("@VerifyNode_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@VerifyNode_Code", verify_Nodes.VerifyNode_Code);
                }
            }
            if (verify_Nodes.VerifyNode_Name_IsChanged)
            {
                if (string.IsNullOrEmpty(verify_Nodes.VerifyNode_Name))
                {
                    idb.AddParameter("@VerifyNode_Name", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@VerifyNode_Name", verify_Nodes.VerifyNode_Name);
                }
            }
            if (verify_Nodes.VerifyNode_Remark_IsChanged)
            {
                if (string.IsNullOrEmpty(verify_Nodes.VerifyNode_Remark))
                {
                    idb.AddParameter("@VerifyNode_Remark", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@VerifyNode_Remark", verify_Nodes.VerifyNode_Remark);
                }
            }
            if (verify_Nodes.VerifyNode_AuditNum_IsChanged)
            {
                if (verify_Nodes.VerifyNode_AuditNum == 0)
                {
                    idb.AddParameter("@VerifyNode_AuditNum", 0);
                }
                else
                {
                    idb.AddParameter("@VerifyNode_AuditNum", verify_Nodes.VerifyNode_AuditNum);
                }
            }
            if (verify_Nodes.Stat_IsChanged)
            {
                if (verify_Nodes.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", verify_Nodes.Stat);
                }
            }

            idb.AddParameter("@VerifyNode_ID", verify_Nodes.VerifyNode_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 26
0
        /// <summary>
        /// 添加审核模板配置表 Verify_TemplateConfig对象(即:一条记录)
        /// </summary>
        public int Add(Verify_TemplateConfig verify_TemplateConfig)
        {
            string sql = "INSERT INTO Verify_TemplateConfig (VT_Template_Code,VT_Key,VT_VerifyNode_Code,VT_VerifyNode_Name,Flag,VT_VerifyNode_Order,VT_VerifyNode_Back,VT_VerifyNode_BackName,VT_Remark,Stat,VT_AcSum,VT_AcNodeName,VT_AcNodeCode) VALUES (@VT_Template_Code,@VT_Key,@VT_VerifyNode_Code,@VT_VerifyNode_Name,@Flag,@VT_VerifyNode_Order,@VT_VerifyNode_Back,@VT_VerifyNode_BackName,@VT_Remark,@Stat,@VT_AcSum,@VT_AcNodeName,@VT_AcNodeCode)";

            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_Template_Code))
            {
                idb.AddParameter("@VT_Template_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_Template_Code", verify_TemplateConfig.VT_Template_Code);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_Key))
            {
                idb.AddParameter("@VT_Key", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_Key", verify_TemplateConfig.VT_Key);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_VerifyNode_Code))
            {
                idb.AddParameter("@VT_VerifyNode_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_Code", verify_TemplateConfig.VT_VerifyNode_Code);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_VerifyNode_Name))
            {
                idb.AddParameter("@VT_VerifyNode_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_Name", verify_TemplateConfig.VT_VerifyNode_Name);
            }
            if (verify_TemplateConfig.Flag == 0)
            {
                idb.AddParameter("@Flag", 0);
            }
            else
            {
                idb.AddParameter("@Flag", verify_TemplateConfig.Flag);
            }
            if (verify_TemplateConfig.VT_VerifyNode_Order == 0)
            {
                idb.AddParameter("@VT_VerifyNode_Order", 0);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_Order", verify_TemplateConfig.VT_VerifyNode_Order);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_VerifyNode_Back))
            {
                idb.AddParameter("@VT_VerifyNode_Back", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_Back", verify_TemplateConfig.VT_VerifyNode_Back);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_VerifyNode_BackName))
            {
                idb.AddParameter("@VT_VerifyNode_BackName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_VerifyNode_BackName", verify_TemplateConfig.VT_VerifyNode_BackName);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_Remark))
            {
                idb.AddParameter("@VT_Remark", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_Remark", verify_TemplateConfig.VT_Remark);
            }
            if (verify_TemplateConfig.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", verify_TemplateConfig.Stat);
            }
            if (verify_TemplateConfig.VT_AcSum == 0)
            {
                idb.AddParameter("@VT_AcSum", 0);
            }
            else
            {
                idb.AddParameter("@VT_AcSum", verify_TemplateConfig.VT_AcSum);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_AcNodeName))
            {
                idb.AddParameter("@VT_AcNodeName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_AcNodeName", verify_TemplateConfig.VT_AcNodeName);
            }
            if (string.IsNullOrEmpty(verify_TemplateConfig.VT_AcNodeCode))
            {
                idb.AddParameter("@VT_AcNodeCode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VT_AcNodeCode", verify_TemplateConfig.VT_AcNodeCode);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 27
0
        /// <summary>
        /// 更新系统消息处理日志 Sys_AnnoceLog对象(即:一条记录
        /// </summary>
        public int Update(Sys_AnnoceLog sys_AnnoceLog)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       Sys_AnnoceLog       SET ");
            if (sys_AnnoceLog.EL_UserCode_IsChanged)
            {
                sbParameter.Append("EL_UserCode=@EL_UserCode, ");
            }
            if (sys_AnnoceLog.EL_Date_IsChanged)
            {
                sbParameter.Append("EL_Date=@EL_Date, ");
            }
            if (sys_AnnoceLog.EL_IP_IsChanged)
            {
                sbParameter.Append("EL_IP=@EL_IP ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and EL_ID=@EL_ID; ");
            string sql = sb.ToString();

            if (sys_AnnoceLog.EL_UserCode_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_AnnoceLog.EL_UserCode))
                {
                    idb.AddParameter("@EL_UserCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@EL_UserCode", sys_AnnoceLog.EL_UserCode);
                }
            }
            if (sys_AnnoceLog.EL_Date_IsChanged)
            {
                if (sys_AnnoceLog.EL_Date == DateTime.MinValue)
                {
                    idb.AddParameter("@EL_Date", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@EL_Date", sys_AnnoceLog.EL_Date);
                }
            }
            if (sys_AnnoceLog.EL_IP_IsChanged)
            {
                if (string.IsNullOrEmpty(sys_AnnoceLog.EL_IP))
                {
                    idb.AddParameter("@EL_IP", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@EL_IP", sys_AnnoceLog.EL_IP);
                }
            }

            idb.AddParameter("@EL_ID", sys_AnnoceLog.EL_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 28
0
        /// <summary>
        /// 添加设备检修计划 Equ_MPlan对象(即:一条记录)
        /// </summary>
        public int Add(Equ_MPlan equ_MPlan)
        {
            string sql = "INSERT INTO Equ_MPlan (MP_Code,MP_Name,MP_Stuff,MP_Start,MP_End,VerifyStuff,VerifyStat,VerifyDate,Stat,MP_ECode,MP_EName) VALUES (@MP_Code,@MP_Name,@MP_Stuff,@MP_Start,@MP_End,@VerifyStuff,@VerifyStat,@VerifyDate,@Stat,@MP_ECode,@MP_EName)";

            if (string.IsNullOrEmpty(equ_MPlan.MP_Code))
            {
                idb.AddParameter("@MP_Code", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_Code", equ_MPlan.MP_Code);
            }
            if (string.IsNullOrEmpty(equ_MPlan.MP_Name))
            {
                idb.AddParameter("@MP_Name", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_Name", equ_MPlan.MP_Name);
            }
            if (string.IsNullOrEmpty(equ_MPlan.MP_Stuff))
            {
                idb.AddParameter("@MP_Stuff", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_Stuff", equ_MPlan.MP_Stuff);
            }
            if (equ_MPlan.MP_Start == DateTime.MinValue)
            {
                idb.AddParameter("@MP_Start", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_Start", equ_MPlan.MP_Start);
            }
            if (equ_MPlan.MP_End == DateTime.MinValue)
            {
                idb.AddParameter("@MP_End", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_End", equ_MPlan.MP_End);
            }
            if (string.IsNullOrEmpty(equ_MPlan.VerifyStuff))
            {
                idb.AddParameter("@VerifyStuff", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyStuff", equ_MPlan.VerifyStuff);
            }
            if (string.IsNullOrEmpty(equ_MPlan.VerifyStat))
            {
                idb.AddParameter("@VerifyStat", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyStat", equ_MPlan.VerifyStat);
            }
            if (equ_MPlan.VerifyDate == DateTime.MinValue)
            {
                idb.AddParameter("@VerifyDate", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@VerifyDate", equ_MPlan.VerifyDate);
            }
            if (equ_MPlan.Stat == 0)
            {
                idb.AddParameter("@Stat", 0);
            }
            else
            {
                idb.AddParameter("@Stat", equ_MPlan.Stat);
            }
            if (string.IsNullOrEmpty(equ_MPlan.MP_ECode))
            {
                idb.AddParameter("@MP_ECode", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_ECode", equ_MPlan.MP_ECode);
            }
            if (string.IsNullOrEmpty(equ_MPlan.MP_EName))
            {
                idb.AddParameter("@MP_EName", DBNull.Value);
            }
            else
            {
                idb.AddParameter("@MP_EName", equ_MPlan.MP_EName);
            }


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 29
0
        /// <summary>
        /// 更新外联协调信息 Outreach_Coordination对象(即:一条记录
        /// </summary>
        public int Update(Outreach_Coordination outreach_Coordination)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       Outreach_Coordination       SET ");
            if (outreach_Coordination.OC_Code_IsChanged)
            {
                sbParameter.Append("OC_Code=@OC_Code, ");
            }
            if (outreach_Coordination.OC_OutretachCode_IsChanged)
            {
                sbParameter.Append("OC_OutretachCode=@OC_OutretachCode, ");
            }
            if (outreach_Coordination.OC_OutreachName_IsChanged)
            {
                sbParameter.Append("OC_OutreachName=@OC_OutreachName, ");
            }
            if (outreach_Coordination.OC_CoordinationType_IsChanged)
            {
                sbParameter.Append("OC_CoordinationType=@OC_CoordinationType, ");
            }
            if (outreach_Coordination.OC_MainContactor_IsChanged)
            {
                sbParameter.Append("OC_MainContactor=@OC_MainContactor, ");
            }
            if (outreach_Coordination.OC_Telephone_IsChanged)
            {
                sbParameter.Append("OC_Telephone=@OC_Telephone, ");
            }
            if (outreach_Coordination.OC_Content_IsChanged)
            {
                sbParameter.Append("OC_Content=@OC_Content, ");
            }
            if (outreach_Coordination.OC_Result_IsChanged)
            {
                sbParameter.Append("OC_Result=@OC_Result, ");
            }
            if (outreach_Coordination.OC_ResultType_IsChanged)
            {
                sbParameter.Append("OC_ResultType=@OC_ResultType, ");
            }
            if (outreach_Coordination.OC_Cost_IsChanged)
            {
                sbParameter.Append("OC_Cost=@OC_Cost, ");
            }
            if (outreach_Coordination.OC_Remark_IsChanged)
            {
                sbParameter.Append("OC_Remark=@OC_Remark, ");
            }
            if (outreach_Coordination.OC_Attachment_IsChanged)
            {
                sbParameter.Append("OC_Attachment=@OC_Attachment, ");
            }
            if (outreach_Coordination.OC_Company_IsChanged)
            {
                sbParameter.Append("OC_Company=@OC_Company, ");
            }
            if (outreach_Coordination.OC_Dept_IsChanged)
            {
                sbParameter.Append("OC_Dept=@OC_Dept, ");
            }
            if (outreach_Coordination.OC_iType_IsChanged)
            {
                sbParameter.Append("OC_iType=@OC_iType, ");
            }
            if (outreach_Coordination.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat, ");
            }
            if (outreach_Coordination.CreateDate_IsChanged)
            {
                sbParameter.Append("CreateDate=@CreateDate, ");
            }
            if (outreach_Coordination.UpdateDate_IsChanged)
            {
                sbParameter.Append("UpdateDate=@UpdateDate, ");
            }
            if (outreach_Coordination.DeleteDate_IsChanged)
            {
                sbParameter.Append("DeleteDate=@DeleteDate ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and OC_ID=@OC_ID; ");
            string sql = sb.ToString();

            if (outreach_Coordination.OC_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_Code))
                {
                    idb.AddParameter("@OC_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_Code", outreach_Coordination.OC_Code);
                }
            }
            if (outreach_Coordination.OC_OutretachCode_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_OutretachCode))
                {
                    idb.AddParameter("@OC_OutretachCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_OutretachCode", outreach_Coordination.OC_OutretachCode);
                }
            }
            if (outreach_Coordination.OC_OutreachName_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_OutreachName))
                {
                    idb.AddParameter("@OC_OutreachName", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_OutreachName", outreach_Coordination.OC_OutreachName);
                }
            }
            if (outreach_Coordination.OC_CoordinationType_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_CoordinationType))
                {
                    idb.AddParameter("@OC_CoordinationType", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_CoordinationType", outreach_Coordination.OC_CoordinationType);
                }
            }
            if (outreach_Coordination.OC_MainContactor_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_MainContactor))
                {
                    idb.AddParameter("@OC_MainContactor", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_MainContactor", outreach_Coordination.OC_MainContactor);
                }
            }
            if (outreach_Coordination.OC_Telephone_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_Telephone))
                {
                    idb.AddParameter("@OC_Telephone", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_Telephone", outreach_Coordination.OC_Telephone);
                }
            }
            if (outreach_Coordination.OC_Content_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_Content))
                {
                    idb.AddParameter("@OC_Content", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_Content", outreach_Coordination.OC_Content);
                }
            }
            if (outreach_Coordination.OC_Result_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_Result))
                {
                    idb.AddParameter("@OC_Result", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_Result", outreach_Coordination.OC_Result);
                }
            }
            if (outreach_Coordination.OC_ResultType_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_ResultType))
                {
                    idb.AddParameter("@OC_ResultType", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_ResultType", outreach_Coordination.OC_ResultType);
                }
            }
            if (outreach_Coordination.OC_Cost_IsChanged)
            {
                if (outreach_Coordination.OC_Cost == 0)
                {
                    idb.AddParameter("@OC_Cost", 0);
                }
                else
                {
                    idb.AddParameter("@OC_Cost", outreach_Coordination.OC_Cost);
                }
            }
            if (outreach_Coordination.OC_Remark_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_Remark))
                {
                    idb.AddParameter("@OC_Remark", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_Remark", outreach_Coordination.OC_Remark);
                }
            }
            if (outreach_Coordination.OC_Attachment_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_Attachment))
                {
                    idb.AddParameter("@OC_Attachment", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_Attachment", outreach_Coordination.OC_Attachment);
                }
            }
            if (outreach_Coordination.OC_Company_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_Company))
                {
                    idb.AddParameter("@OC_Company", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_Company", outreach_Coordination.OC_Company);
                }
            }
            if (outreach_Coordination.OC_Dept_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_Dept))
                {
                    idb.AddParameter("@OC_Dept", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_Dept", outreach_Coordination.OC_Dept);
                }
            }
            if (outreach_Coordination.OC_iType_IsChanged)
            {
                if (string.IsNullOrEmpty(outreach_Coordination.OC_iType))
                {
                    idb.AddParameter("@OC_iType", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@OC_iType", outreach_Coordination.OC_iType);
                }
            }
            if (outreach_Coordination.Stat_IsChanged)
            {
                if (outreach_Coordination.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", outreach_Coordination.Stat);
                }
            }
            if (outreach_Coordination.CreateDate_IsChanged)
            {
                if (outreach_Coordination.CreateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@CreateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@CreateDate", outreach_Coordination.CreateDate);
                }
            }
            if (outreach_Coordination.UpdateDate_IsChanged)
            {
                if (outreach_Coordination.UpdateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@UpdateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@UpdateDate", outreach_Coordination.UpdateDate);
                }
            }
            if (outreach_Coordination.DeleteDate_IsChanged)
            {
                if (outreach_Coordination.DeleteDate == DateTime.MinValue)
                {
                    idb.AddParameter("@DeleteDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@DeleteDate", outreach_Coordination.DeleteDate);
                }
            }

            idb.AddParameter("@OC_ID", outreach_Coordination.OC_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }
Esempio n. 30
0
        /// <summary>
        /// 更新考评信息 HR_Evaluation对象(即:一条记录
        /// </summary>
        public int Update(HR_Evaluation hR_Evaluation)
        {
            StringBuilder sbParameter = new StringBuilder();
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"UPDATE       HR_Evaluation       SET ");
            if (hR_Evaluation.Eva_Code_IsChanged)
            {
                sbParameter.Append("Eva_Code=@Eva_Code, ");
            }
            if (hR_Evaluation.Eva_StuffCode_IsChanged)
            {
                sbParameter.Append("Eva_StuffCode=@Eva_StuffCode, ");
            }
            if (hR_Evaluation.Eva_StuffName_IsChanged)
            {
                sbParameter.Append("Eva_StuffName=@Eva_StuffName, ");
            }
            if (hR_Evaluation.Eva_Date_IsChanged)
            {
                sbParameter.Append("Eva_Date=@Eva_Date, ");
            }
            if (hR_Evaluation.Eva_Records_IsChanged)
            {
                sbParameter.Append("Eva_Records=@Eva_Records, ");
            }
            if (hR_Evaluation.Eva_Conclusion_IsChanged)
            {
                sbParameter.Append("Eva_Conclusion=@Eva_Conclusion, ");
            }
            if (hR_Evaluation.Eva_Manager_IsChanged)
            {
                sbParameter.Append("Eva_Manager=@Eva_Manager, ");
            }
            if (hR_Evaluation.Eva_Level_IsChanged)
            {
                sbParameter.Append("Eva_Level=@Eva_Level, ");
            }
            if (hR_Evaluation.Eva_Bak_IsChanged)
            {
                sbParameter.Append("Eva_Bak=@Eva_Bak, ");
            }
            if (hR_Evaluation.Stat_IsChanged)
            {
                sbParameter.Append("Stat=@Stat, ");
            }
            if (hR_Evaluation.CreateDate_IsChanged)
            {
                sbParameter.Append("CreateDate=@CreateDate, ");
            }
            if (hR_Evaluation.UpdateDate_IsChanged)
            {
                sbParameter.Append("UpdateDate=@UpdateDate, ");
            }
            if (hR_Evaluation.DeleteDate_IsChanged)
            {
                sbParameter.Append("DeleteDate=@DeleteDate ");
            }
            sb.Append(sbParameter.ToString().Trim().TrimEnd(','));
            sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0))   and Eva_ID=@Eva_ID; ");
            string sql = sb.ToString();

            if (hR_Evaluation.Eva_Code_IsChanged)
            {
                if (string.IsNullOrEmpty(hR_Evaluation.Eva_Code))
                {
                    idb.AddParameter("@Eva_Code", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Eva_Code", hR_Evaluation.Eva_Code);
                }
            }
            if (hR_Evaluation.Eva_StuffCode_IsChanged)
            {
                if (string.IsNullOrEmpty(hR_Evaluation.Eva_StuffCode))
                {
                    idb.AddParameter("@Eva_StuffCode", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Eva_StuffCode", hR_Evaluation.Eva_StuffCode);
                }
            }
            if (hR_Evaluation.Eva_StuffName_IsChanged)
            {
                if (string.IsNullOrEmpty(hR_Evaluation.Eva_StuffName))
                {
                    idb.AddParameter("@Eva_StuffName", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Eva_StuffName", hR_Evaluation.Eva_StuffName);
                }
            }
            if (hR_Evaluation.Eva_Date_IsChanged)
            {
                if (hR_Evaluation.Eva_Date == DateTime.MinValue)
                {
                    idb.AddParameter("@Eva_Date", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Eva_Date", hR_Evaluation.Eva_Date);
                }
            }
            if (hR_Evaluation.Eva_Records_IsChanged)
            {
                if (string.IsNullOrEmpty(hR_Evaluation.Eva_Records))
                {
                    idb.AddParameter("@Eva_Records", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Eva_Records", hR_Evaluation.Eva_Records);
                }
            }
            if (hR_Evaluation.Eva_Conclusion_IsChanged)
            {
                if (string.IsNullOrEmpty(hR_Evaluation.Eva_Conclusion))
                {
                    idb.AddParameter("@Eva_Conclusion", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Eva_Conclusion", hR_Evaluation.Eva_Conclusion);
                }
            }
            if (hR_Evaluation.Eva_Manager_IsChanged)
            {
                if (string.IsNullOrEmpty(hR_Evaluation.Eva_Manager))
                {
                    idb.AddParameter("@Eva_Manager", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Eva_Manager", hR_Evaluation.Eva_Manager);
                }
            }
            if (hR_Evaluation.Eva_Level_IsChanged)
            {
                if (string.IsNullOrEmpty(hR_Evaluation.Eva_Level))
                {
                    idb.AddParameter("@Eva_Level", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Eva_Level", hR_Evaluation.Eva_Level);
                }
            }
            if (hR_Evaluation.Eva_Bak_IsChanged)
            {
                if (string.IsNullOrEmpty(hR_Evaluation.Eva_Bak))
                {
                    idb.AddParameter("@Eva_Bak", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@Eva_Bak", hR_Evaluation.Eva_Bak);
                }
            }
            if (hR_Evaluation.Stat_IsChanged)
            {
                if (hR_Evaluation.Stat == 0)
                {
                    idb.AddParameter("@Stat", 0);
                }
                else
                {
                    idb.AddParameter("@Stat", hR_Evaluation.Stat);
                }
            }
            if (hR_Evaluation.CreateDate_IsChanged)
            {
                if (hR_Evaluation.CreateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@CreateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@CreateDate", hR_Evaluation.CreateDate);
                }
            }
            if (hR_Evaluation.UpdateDate_IsChanged)
            {
                if (hR_Evaluation.UpdateDate == DateTime.MinValue)
                {
                    idb.AddParameter("@UpdateDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@UpdateDate", hR_Evaluation.UpdateDate);
                }
            }
            if (hR_Evaluation.DeleteDate_IsChanged)
            {
                if (hR_Evaluation.DeleteDate == DateTime.MinValue)
                {
                    idb.AddParameter("@DeleteDate", DBNull.Value);
                }
                else
                {
                    idb.AddParameter("@DeleteDate", hR_Evaluation.DeleteDate);
                }
            }

            idb.AddParameter("@Eva_ID", hR_Evaluation.Eva_ID);


            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();

            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = "0";

            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                param.Add(item.Key, item.Value);
            }
            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }

            SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex);

            return(Re);
        }