Ejemplo n.º 1
0
        /// <summary>
        /// 新增合同
        /// </summary>
        /// <param name="CompanyCD"></param>
        /// <param name="CompanyNo"></param>
        /// <returns></returns>
        public static bool InsertPurchaseContract(PurchaseContractModel model, string DetailProductID, string DetailProductNo, string DetailProductName, string DetailUnitID, string DetailProductCount, string DetailUnitPrice, string DetailTaxPrice, string DetailDiscount, string DetailTaxRate, string DetailTotalPrice, string DetailTotalFee, string DetailTotalTax, string DetailRequireDate, string DetailApplyReason, string DetailRemark, string DetailFromBillID, string DetailFromLineNo, string DetailUsedUnitID, string DetailUsedUnitCount, string DetailUsedPrice, string DetailExRate, string length, out string ID, Hashtable ht)
        {
            try
            {
                ////获取登陆用户ID
                //string loginUserID = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID;
                //return PurchaseContractDBHelper.InsertPurchaseContract(model, DetailProductID, DetailProductNo, DetailProductName, DetailUnitID, DetailProductCount, DetailUnitPrice, DetailTaxPrice, DetailDiscount, DetailTaxRate, DetailTotalPrice, DetailTotalFee, DetailTotalTax, DetailRequireDate, DetailApplyReason, DetailRemark, DetailFromBillID, DetailFromLineNo, length, out ID);

                bool         succ     = false;
                LogInfoModel logModel = InitLogInfo(model.ContractNo);
                logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                //设置模块ID 模块ID请在ConstUtil中定义,以便维护
                logModel.ModuleID = ConstUtil.MODULE_ID_PurchaseContract_Add;
                succ = PurchaseContractDBHelper.InsertPurchaseContract(model, DetailProductID, DetailProductNo, DetailProductName, DetailUnitID, DetailProductCount, DetailUnitPrice, DetailTaxPrice, DetailDiscount, DetailTaxRate, DetailTotalPrice, DetailTotalFee, DetailTotalTax, DetailRequireDate, DetailApplyReason, DetailRemark, DetailFromBillID, DetailFromLineNo, DetailUsedUnitID, DetailUsedUnitCount, DetailUsedPrice, DetailExRate, length, out ID, ht);
                if (!succ)
                {
                    logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
                }
                else
                {
                    logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                LogDBHelper.InsertLog(logModel);
                return(succ);
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
            #region
            //string CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
            ////model.CompanyCD = CompanyCD;
            ////string CompanyCD = "AAAAAA";
            //try
            //{
            //    ////int length = 3 + str.Length + str2.Length;//SQL语句长度
            //    ////string[] sql = new string[length];
            //    //return PurchaseContractDBHelper.InsertPurchaseContract(model);

            //    ////for (int i = 0; i < str.Length; ++i)
            //    ////{
            //    ////    PurchaseContractDBHelper.InsertDtlS(model,DetailID, DetailProductNo, DetailProductName, DetailProductCount, DetailUnitID, DetailRequireDate, DetailUnitPrice, DetailTotalPrice, DetailApplyReason, DetailRemark, DetailFromBillID, DetailFromLineNo, length);
            //    ////}
            //    ////SqlHelper.ExecuteTransForListWithSQL(sql);
            //    ////return SqlHelper.Result.OprateCount > 0 ? true : false;
            //    int Creator = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeID;
            //    bool result = false;



            //    #region 合同添加SQL语句
            //    //SQL拼写
            //    StringBuilder sqlc = new StringBuilder();
            //    SqlDateTime signdate = model.SignDate == null ? SqlDateTime.Null : SqlDateTime.Parse(model.SignDate.ToString());
            //    SqlDateTime confirmdate = model.ConfirmDate == null ? SqlDateTime.Null : SqlDateTime.Parse(model.ConfirmDate.ToString());
            //    SqlDateTime closedate = model.CloseDate == null ? SqlDateTime.Null : SqlDateTime.Parse(model.CloseDate.ToString());
            //    SqlDateTime createdate = model.CreateDate == null ? SqlDateTime.Null : SqlDateTime.Parse(model.CreateDate.ToString());
            //    sqlc.AppendLine("Insert into officedba.PurchaseContract");
            //    sqlc.AppendLine("(CompanyCD,ContractNo,Title,ProviderID,FromType,FromBillID,");
            //    sqlc.AppendLine("TotalPrice,CurrencyType,Rate,PayType,SignDate,");
            //    sqlc.AppendLine("Seller,TheyDelegate,OurDelegate,Status,Note,");
            //    sqlc.AppendLine("TakeType,CarryType,Attachment,remark,BillStatus,Creator,");
            //    sqlc.AppendLine("CreateDate,ModifiedDate,ModifiedUserID,Confirmor,ConfirmDate,Closer,CloseDate,");
            //    sqlc.AppendLine("DeptID,TotalTax,TotalFee,Discount,DiscountTotal,RealTotal,isAddTax,CountTotal,TypeID,SignAddr,MoneyType)");
            //    sqlc.AppendLine("values('" + model.CompanyCD + "','" + model.ContractNo + "','" + model.Title + "'," + model.ProviderID + ",'" + model.FromType + "'");
            //    sqlc.AppendLine("," + model.FromBillID + "," + model.TotalPrice + "," + model.CurrencyType + "," + model.Rate + "," + model.PayType + "");
            //    if (signdate.IsNull)
            //    {
            //        sqlc.AppendLine("," + signdate + "");
            //    }
            //    else
            //    {
            //        sqlc.AppendLine(",'"+signdate+"'");
            //    }
            //    sqlc.AppendLine("," + model.Seller + ",'" + model.TheyDelegate + "'," + model.OurDelegate + ",'" + model.Status + "'");
            //    sqlc.AppendLine(",'" + model.Note + "'," + model.TakeType + "," + model.CarryType + ",'" + model.Attachment + "','" + model.remark + "'");
            //    sqlc.AppendLine(", '" + model.BillStatus + "'," + Creator+ "");
            //    if (createdate.IsNull)
            //    {
            //        sqlc.AppendLine(","+createdate+"");
            //    }
            //    else
            //    {
            //        sqlc.AppendLine(",'" + createdate + "'");
            //    }
            //    sqlc.AppendLine(",getdate(),'" + model.ModifiedUserID + "'," + model.Confirmor + "");
            //    if (confirmdate.IsNull)
            //    {
            //        sqlc.AppendLine("," + confirmdate + "");
            //    }
            //    else
            //    {
            //        sqlc.AppendLine(",'"+confirmdate+"'");
            //    }
            //    sqlc.AppendLine("," + model.Closer + "");
            //    if (closedate.IsNull)
            //    {
            //        sqlc.AppendLine(","+closedate+"");
            //    }
            //    else
            //    {
            //        sqlc.AppendLine(",'"+closedate+"'");
            //    }
            //    sqlc.AppendLine("," + model.DeptID + "," + model.TotalTax + "," + model.TotalFee + "," + model.Discount + "," + model.DiscountTotal + "," + model.RealTotal + ",'" + model.isAddTax + "'," + model.CountTotal + "," + model.TypeID + ",'" + model.SignAddr + "','" + model.MoneyType + "')");

            //   // sqlc.AppendLine(",'" + model.BillStatus + "'," + model.Creator + ", '"+createdate+"',getdate(),'" + model.ModifiedUserID + "'");
            //   // sqlc.AppendLine("," + model.Confirmor + "," +confirmdate+ "," + model.Closer + ","+closedate+" )");
            //    #endregion
            //    string[] sql = null;
            //    int lengs = Convert.ToInt32(length);
            //    if (lengs > 0)
            //    {
            //        sql = new string[lengs+1];
            //        sql[0] = sqlc.ToString();
            //        string[] ProductID = DetailProductID.Split(',');
            //        string[] ProductNo = DetailProductNo.Split(',');
            //        string[] ProductName = DetailProductName.Split(',');
            //        string[] Standard = DetailStandard.Split(',');//规格
            //        string[] UnitID = DetailUnitID.Split(',');
            //        string[] ProductCount = DetailProductCount.Split(',');
            //        string[] UnitPrice = DetailUnitPrice.Split(',');//单价
            //        string[] TaxPrice = DetailTaxPrice.Split(',');//含税价
            //        string[] Discount = DetailDiscount.Split(',');//折扣
            //        string[] TaxRate = DetailTaxRate.Split(',');//税率
            //        string[] TotalPrice = DetailTotalPrice.Split(',');//金额
            //        string[] TotalFee = DetailTotalFee.Split(',');//含税金额
            //        string[] TotalTax = DetailTotalTax.Split(',');//税额
            //        string[] RequireDate = DetailRequireDate.Split(',');
            //        string[] ApplyReason = DetailApplyReason.Split(',');
            //        string[] Remark = DetailRemark.Split(',');
            //        string[] FromBillID = DetailFromBillID.Split(',');
            //        string[] FromLineNo = DetailFromLineNo.Split(',');
            //        for (int i = 1; i <=lengs; i++)
            //        {
            //            SqlDateTime mRequireDate;
            //            decimal mTotalPrice, mUnitID;
            //            decimal mUnitPrice, mProductCount, mTaxPrice, mDiscount, mTaxRate, mTotalFee, mTotalTax;
            //            //if (RequireDate[i-1].ToString() == "")
            //            //{
            //            //    mRequireDate = SqlDateTime.Null;
            //            //}
            //            //else
            //            //{
            //            //    mRequireDate = SqlDateTime.Parse(RequireDate[i-1].ToString());
            //            //}
            //            if (UnitPrice[i - 1].ToString() == "")
            //            {
            //                mUnitPrice = 0;
            //            }
            //            else
            //            {
            //                mUnitPrice = Convert.ToDecimal(UnitPrice[i - 1].ToString());
            //            }
            //            if (ProductCount[i - 1].ToString() == "")
            //            {
            //                mProductCount = 0;
            //            }
            //            else
            //            {
            //                mProductCount = Convert.ToDecimal(ProductCount[i - 1].ToString());
            //            }
            //            if (TotalPrice[i - 1].ToString() == "")
            //            {
            //                mTotalPrice = 0;
            //            }
            //            else
            //            {
            //                mTotalPrice = Convert.ToDecimal(TotalPrice[i - 1].ToString());
            //            }
            //            if (TaxPrice[i - 1].ToString() == "")
            //            {
            //                mTaxPrice = 0;
            //            }
            //            else
            //            {
            //                mTaxPrice = Convert.ToDecimal(TaxPrice[i - 1].ToString());
            //            }
            //            if (Discount[i - 1].ToString() == "")
            //            {
            //                mDiscount = 0;
            //            }
            //            else
            //            {
            //                mDiscount = Convert.ToDecimal(Discount[i - 1].ToString());
            //            }
            //            if (TaxRate[i - 1].ToString() == "")
            //            {
            //                mTaxRate = 0;
            //            }
            //            else
            //            {
            //                mTaxRate = Convert.ToDecimal(TaxRate[i - 1].ToString());
            //            }
            //            if (TotalFee[i - 1].ToString() == "")
            //            {
            //                mTotalFee = 0;
            //            }
            //            else
            //            {
            //                mTotalFee = Convert.ToDecimal(TotalFee[i - 1].ToString());
            //            }
            //            if (TotalTax[i - 1].ToString() == "")
            //            {
            //                mTotalTax = 0;
            //            }
            //            else
            //            {
            //                mTotalTax = Convert.ToDecimal(TotalTax[i - 1].ToString());
            //            }
            //            if (UnitID[i - 1].ToString() == "")
            //            {
            //                mUnitID = 0;
            //            }
            //            else
            //            {
            //                mUnitID = Convert.ToDecimal(UnitID[i - 1].ToString());
            //            }
            //            System.Text.StringBuilder cmdsql = new System.Text.StringBuilder();
            //            cmdsql.AppendLine(" Insert into  officedba.PurchaseContractDetail(CompanyCD,ContractNo,ProductID,ProductNo,ProductName,standard,UnitID,ProductCount,");
            //            cmdsql.AppendLine("UnitPrice,TaxPrice,Discount,TaxRate,TotalPrice,TotalFee,TotalTax,RequireDate,ApplyReason,Remark,FromBillID,FromLineNo)");
            //            cmdsql.AppendLine(" Values('" + model.CompanyCD + "','" + model.ContractNo + "','" + ProductID[i - 1].ToString() + "','" + ProductNo[i - 1].ToString() + "','" + ProductName[i - 1].ToString() + "','" + Standard[i - 1].ToString() + "'");
            //            cmdsql.AppendLine(",'" + mUnitID + "','" + mProductCount + "','" + mUnitPrice + "','" + mTaxPrice + "','" + mDiscount + "','" + mTaxRate + "','" + mTotalPrice + "','" + mTotalFee + "','" + mTotalTax + "'");
            //            if (RequireDate[i - 1].ToString() == "")
            //            {
            //                mRequireDate = SqlDateTime.Null;
            //                cmdsql.AppendLine(","+mRequireDate+"");
            //            }
            //            else
            //            {
            //                mRequireDate = SqlDateTime.Parse(RequireDate[i - 1].ToString());
            //                cmdsql.AppendLine(",'"+mRequireDate+"'");
            //            }
            //            cmdsql.AppendLine(",'" + ApplyReason[i - 1].ToString() + "','" + Remark[i - 1].ToString() + "','" + FromBillID[i - 1].ToString() + "','" + FromLineNo[i - 1].ToString() + "')");
            //            sql[i] = cmdsql.ToString();

            //        }
            //        if (PurchaseContractDBHelper.InsertPurchaseContract(sql))
            //            {
            //                //model.ID = IDIdentityUtil.GetIDIdentity("officedba.PurchaseContract");
            //                result = true;
            //            }
            //    }
            //    else
            //    {
            //        sql = new string[1];
            //        sql[0] = sqlc.ToString();
            //        if (PurchaseContractDBHelper.InsertPurchaseContract(sql))
            //        {
            //            model.ID = IDIdentityUtil.GetIDIdentity("officedba.PurchaseContract");
            //            result = true;
            //        }
            //    }
            //    return result;
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            #endregion
        }
Ejemplo n.º 2
0
        public static bool SaveAgendaInfo(PersonalDateArrange model)
        {
            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //设置公司代码
            model.CompanyCD = userInfo.CompanyCD;
            //定义返回变量
            bool isSucc = false;

            //ID存在时,更新
            if (ConstUtil.EDIT_FLAG_UPDATE.Equals(model.EditFlag))
            {
                try
                {
                    //执行更新操作
                    isSucc = AgendaInfoDBHelper.UpdateAgendaInfo(model);
                    LogInfoModel logModel = InitLogInfo("更新日程");
                    if (isSucc)
                    {
                        logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
                    }
                    else
                    {
                        logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
                    }
                    logModel.Element  = ConstUtil.LOG_PROCESS_UPDATE;
                    logModel.ModuleID = "10411";
                    LogDBHelper.InsertLog(logModel);
                }
                catch (Exception ex)
                {
                    WriteSystemLog(userInfo, ex, ConstUtil.MODULE_ID_AGENDA_INFO);
                }
            }
            //插入
            else
            {
                try
                {
                    //执行插入操作
                    isSucc = AgendaInfoDBHelper.InsertAgendaInfo(model);
                    LogInfoModel logModel = InitLogInfo("新建日程");
                    if (isSucc)
                    {
                        logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
                    }
                    else
                    {
                        logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
                    }
                    logModel.Element  = ConstUtil.LOG_PROCESS_INSERT;
                    logModel.ModuleID = "10411";
                    LogDBHelper.InsertLog(logModel);
                }
                catch (Exception ex)
                {
                    WriteSystemLog(userInfo, ex, ConstUtil.MODULE_ID_AGENDA_INFO);
                }
            }
            return(isSucc);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据会议室ID删除会议室信息
        /// </summary>
        /// <param name="MeetingRoomID">会议室ID</param>
        /// <returns>操作记录数</returns>
        public static int DelMeetingRoom(string[] MeetingRoomID)
        {
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            LogInfoModel logModel = new LogInfoModel(); //操作日志
            int          isSucc   = 0;                  //定义返回变量

            #region 设置操作日志内容
            //设置公司代码
            logModel.CompanyCD = userInfo.CompanyCD;
            //设置登陆用户ID
            logModel.UserID = userInfo.UserID;
            //设置模块ID 模块ID在ConstUtil中定义,以便维护
            logModel.ModuleID = ConstUtil.MODULE_ID_MEETINGROOM_LIST;

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            for (int i = 0; i < MeetingRoomID.Length; i++)
            {
                sb.Append(MeetingRoomID[i] + ";");
            }

            //操作单据编号
            logModel.ObjectID = "会议室ID:" + sb.ToString();
            //操作对象 操作的表信息
            logModel.ObjectName = ConstUtil.TABLE_NAME_MEETINGROOM;
            //涉及关键元素 涉及其他业务、表关系
            logModel.Element = ConstUtil.LOG_PROCESS_DELETE;
            //备注 操作类型
            logModel.Remark = ConstUtil.LOG_PROCESS_DELETE;
            #endregion

            try
            {
                isSucc = LinkManDBHelper.DelLinkInfo(MeetingRoomID, ConstUtil.TABLE_NAME_MEETINGROOM);
            }
            catch (System.Exception ex)
            {
                #region  操作失败时记录日志到文件
                //定义变量
                LogInfo logSys = new LogInfo();
                //设置日志类型 需要指定为系统日志
                logSys.Type = LogInfo.LogType.SYSTEM;
                //指定系统日志类型 出错信息
                logSys.SystemKind = LogInfo.SystemLogKind.SYSTEM_ERROR;
                //指定登陆用户信息
                logSys.UserInfo = userInfo;
                //设定模块ID
                logSys.ModuleID = ConstUtil.MODULE_ID_MEETINGROOM_LIST;
                //描述
                logSys.Description = ex.ToString();
                //输出日志
                LogUtil.WriteLog(logSys);
                #endregion
            }
            if (isSucc > 0)//操作成功
            {
                logModel.Remark += "成功";
            }
            else//操作失败
            {
                logModel.Remark += "失败";
            }

            //记录日志
            LogDBHelper.InsertLog(logModel);

            return(isSucc);
        }
Ejemplo n.º 4
0
        public static string UpdateStatus(Model.Office.StorageManager.StorageReturn sr, string stype)
        {
            //定义返回变量
            bool res = false;

            /*
             * 定义日志内容变量
             * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
             * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
             */
            //获取当前用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //执行操作
            try
            {
                //执行操作
                res = XBase.Data.Office.StorageManager.StorageReturnDBHelper.UpdateStatus(sr, stype);
            }
            catch (Exception ex)
            {
                //输出日志
                WriteSystemLog(userInfo, ex);
            }
            //定义变量
            string remark;

            //成功时
            if (res)
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            else
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            //操作日志
            LogInfoModel logModel = InitLogInfo(sr.ReturnNo);

            //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
            if (stype == "1")
            {
                logModel.Element = ConstUtil.LOG_PROCESS_CONFIRM;
            }
            else if (stype == "2")
            {
                logModel.Element = ConstUtil.LOG_PROCESS_COMPLETE;
            }
            else if (stype == "3")
            {
                logModel.Element = ConstUtil.LOG_PROCESS_CONCELCOMPLETE;
            }
            //设置操作成功标识
            logModel.Remark = remark;

            //登陆日志
            LogDBHelper.InsertLog(logModel);
            if (res)
            {
                return("1");
            }
            else
            {
                return("0");
            }
        }
Ejemplo n.º 5
0
        //private static UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];//获取登陆用户信息

        #region 添加请示信息的方法
        /// <summary>
        /// 添加请示信息的方法
        /// </summary>
        /// <param name="DocRequstM">请示信息</param>
        /// <returns>被添加请示ID</returns>
        public static int DocRequstAdd(DocRequstModel DocRequstM)
        {
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            LogInfoModel logModel = new LogInfoModel(); //操作日志
            int          isSucc   = 0;                  //定义返回变量

            #region 设置操作日志内容
            //设置公司代码
            logModel.CompanyCD = userInfo.CompanyCD;
            //设置登陆用户ID
            logModel.UserID = userInfo.UserID;
            //设置模块ID 模块ID在ConstUtil中定义,以便维护
            logModel.ModuleID = ConstUtil.MODULE_ID_DOCREQUST_ADD;
            //操作单据编号  请示编号
            logModel.ObjectID = DocRequstM.DocumentNo;
            //操作对象 操作的表信息
            logModel.ObjectName = ConstUtil.TABLE_NAME_DOCREQUST;
            //涉及关键元素 涉及其他业务、表关系
            logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
            //备注 操作类型
            logModel.Remark = ConstUtil.LOG_PROCESS_INSERT;
            #endregion

            try
            {
                isSucc = DocRequstDBHelper.DocRequstAdd(DocRequstM);
            }
            catch (System.Exception ex)
            {
                #region  操作失败时记录日志到文件
                //定义变量
                LogInfo logSys = new LogInfo();
                //设置日志类型 需要指定为系统日志
                logSys.Type = LogInfo.LogType.SYSTEM;
                //指定系统日志类型 出错信息
                logSys.SystemKind = LogInfo.SystemLogKind.SYSTEM_ERROR;
                //指定登陆用户信息
                logSys.UserInfo = userInfo;
                //设定模块ID
                logSys.ModuleID = ConstUtil.MODULE_ID_DOCREQUST_ADD;
                //描述
                logSys.Description = ex.ToString();
                //输出日志
                LogUtil.WriteLog(logSys);
                #endregion
            }

            if (isSucc > 0)//操作成功
            {
                logModel.Remark += "成功";
            }
            else//操作失败
            {
                logModel.Remark += "失败";
            }

            //记录日志
            LogDBHelper.InsertLog(logModel);

            return(isSucc);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 保存评分项目信息
        /// </summary>
        /// <param name="model"> 评分项目实体</param>
        /// <returns></returns>
        public static bool SaveProTaskInfo(PerformanceTaskModel model, IList <PerformanceScoreModel> modellist, IList <PerformanceSummaryModel> modleSummaryList)
        {
            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //设置公司代码
            model.CompanyCD = userInfo.CompanyCD;
            //设置最后修改者
            model.ModifiedUserID = userInfo.UserID;
            //定义返回变量

            bool isSucc = false;
            //操作日志
            LogInfoModel logModel = InitLogInfo(model.TaskNo);

            //更新
            if (ConstUtil.EDIT_FLAG_UPDATE.Equals(model.EditFlag))
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                    //执行更新操作
                    isSucc = PerformanceTaskDBHelper.UpdatePerTaskInfo(model, modellist, modleSummaryList);
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //插入
            else
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                    //执行插入操作

                    isSucc = PerformanceTaskDBHelper.InsertPerTaskInfo(model);
                    if (isSucc)
                    {
                        if (PerformanceTaskDBHelper.InsertPerScoreInfo(modellist))
                        {
                            if (PerformanceTaskDBHelper.InsertPerSummaryInfo(modleSummaryList))
                            {
                                isSucc = true;
                            }
                            else
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            isSucc = false;
                        }
                    }
                    else
                    {
                        isSucc = false;
                    }



                    logModel.ObjectID = model.TaskNo;
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //更新成功时
            if (isSucc)
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            //更新不成功
            else
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
            }

            //登陆日志
            LogDBHelper.InsertLog(logModel);

            return(isSucc);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 保存评分项目信息
        /// </summary>
        /// <param name="model"> 评分项目实体</param>
        /// <returns></returns>
        public static bool SaveProScoreInfo(IList <PerformanceScoreModel> modellist)
        {
            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];


            bool isSucc = false;
            //操作日志
            LogInfoModel logModel = InitLogInfo(modellist[0].TaskNo);

            //更新
            if (ConstUtil.EDIT_FLAG_UPDATE.Equals(modellist[0].EditFlag))
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                    //执行更新操作
                    isSucc = PerformanceCheckDBHelper.UpdatePerScoreInfo(modellist);
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //插入
            else
            {
                try
                {
                    //logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                    ////执行插入操作

                    //isSucc = PerformanceCheckDBHelper.InsertPerTaskInfo(model);
                    //if (isSucc)
                    //{
                    //    if (PerformanceCheckDBHelper.InsertPerScoreInfo(modellist))
                    //    {
                    //        if (PerformanceCheckDBHelper.InsertPerSummaryInfo(modleSummaryList))
                    //        {
                    //            isSucc = true;
                    //        }
                    //        else
                    //        { return false; }
                    //    }
                    //    else
                    //    {
                    //        isSucc = false;
                    //    }


                    //}
                    //else
                    //{
                    //    isSucc = false;
                    //}



                    logModel.ObjectID = modellist[0].TaskNo;
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //更新成功时
            if (isSucc)
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            //更新不成功
            else
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
            }

            //登陆日志
            LogDBHelper.InsertLog(logModel);

            return(isSucc);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 更新采购询价单
        /// </summary>
        /// <param name="PurchaseAskPriceM">采购询价单主表model</param>
        /// <param name="PurchaseAskPriceDetailMList">采购询价单明细表model列表</param>
        /// <returns>bool</returns>
        ///
        public static bool UpdatePurchaseAskPrice(PurchaseAskPriceModel PurchaseAskPriceM
                                                  , List <PurchaseAskPriceDetailModel> PurchaseAskPriceDetailMList, Hashtable htExtAttr)
        {
            try
            {
                ArrayList lstUpdate = new ArrayList();
                if (PurchaseAskPriceM.AskAgain == "1")
                {//再次询价,需将此次询价之前的那次询价记录记入询价历史表
                    SqlCommand AskAgain = PurchaseAskPriceDBHelper.InsertPurchaseAskHistory(PurchaseAskPriceM.ID);
                    lstUpdate.Add(AskAgain);
                }
                SqlCommand UpdatePri = PurchaseAskPriceDBHelper.UpdatePurAskPricePri(PurchaseAskPriceM);
                lstUpdate.Add(UpdatePri);
                #region 拓展属性
                SqlCommand cmd = new SqlCommand();
                GetExtAttrCmd(PurchaseAskPriceM, htExtAttr, cmd);
                if (htExtAttr.Count > 0)
                {
                    lstUpdate.Add(cmd);
                }
                #endregion

                SqlCommand DelDtl = PurchaseAskPriceDBHelper.DeletePurAskPriceDetail(PurchaseAskPriceM.AskNo);
                lstUpdate.Add(DelDtl);
                foreach (PurchaseAskPriceDetailModel PurchaseAskPriceDetailM in PurchaseAskPriceDetailMList)
                {
                    SqlCommand AddDtl = PurchaseAskPriceDBHelper.InsertPurAskPriceDetail(PurchaseAskPriceDetailM);
                    lstUpdate.Add(AddDtl);
                }

                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                //定义返回变量
                bool isSucc = false;

                /*
                 * 定义日志内容变量
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstUpdate);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }


                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                LogInfoModel logModel = InitLogInfo(PurchaseAskPriceM.AskNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return(isSucc);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 9
0
        public static bool CancelConfirm(string ID, string No)
        {
            try
            {
                //被引用不可以取消确认
                if (PurchaseAskPriceDBHelper.IsCite(ID))
                {
                    return(false);
                }

                ArrayList lstCancelConfirm = new ArrayList();
                //主表操作
                lstCancelConfirm.Add(PurchaseAskPriceDBHelper.CancelConfirm(ID));
                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

                //撤销审批
                string    CompanyCD    = userInfo.CompanyCD;
                string    BillTypeFlag = ConstUtil.CODING_RULE_PURCHASE;
                string    BillTypeCode = ConstUtil.CODING_RULE_PURCHASE_ASKPRICE;
                string    strUserID    = userInfo.UserID;;
                DataTable dt           = FlowDBHelper.GetFlowInstanceInfo(CompanyCD, Convert.ToInt32(BillTypeFlag), Convert.ToInt32(BillTypeCode), Convert.ToInt32(ID));
                if (dt.Rows.Count > 0)
                {
                    string FlowInstanceID = dt.Rows[0]["FlowInstanceID"].ToString();
                    string FlowStatus     = dt.Rows[0]["FlowStatus"].ToString();
                    string FlowNo         = dt.Rows[0]["FlowNo"].ToString();

                    lstCancelConfirm.Add(FlowDBHelper.CancelConfirmHis(CompanyCD, FlowInstanceID, FlowNo, BillTypeFlag, BillTypeCode, strUserID));
                    lstCancelConfirm.Add(FlowDBHelper.CancelConfirmTsk(CompanyCD, FlowInstanceID, strUserID));
                    lstCancelConfirm.Add(FlowDBHelper.CancelConfirmIns(CompanyCD, FlowNo, BillTypeFlag, BillTypeCode, ID, strUserID));
                }

                //定义返回变量
                bool isSucc = false;

                /*
                 * 定义日志内容变量
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstCancelConfirm);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }
                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                LogInfoModel logModel = InitLogInfo(No);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_UNCONFIRM;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return(isSucc);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 修改采购申请
        /// </summary>
        /// <param name="PurchaseApplyM">主表</param>
        /// <param name="str">明细来源</param>
        /// <param name="start"></param>
        /// <param name="end">从start--end需要更新,end以后要插入</param>
        /// <param name="str2">明细信息</param>
        /// <param name="ApplyNo"></param>
        /// <returns></returns>
        public static bool UpdatePurchaseApply(PurchaseApplyModel PurchaseApplyM, List <PurchaseApplyDetailSourceModel> PurchaseApplyDetailSourceMList
                                               , List <PurchaseApplyDetailModel> PurchaseApplyDetailMList, Hashtable htExtAttr)
        {
            try
            {
                ArrayList lstUpdate = new ArrayList();
                //更新主表
                SqlCommand UpdatePri = PurchaseApplyDBHelper.UpdatePrimary(PurchaseApplyM);
                lstUpdate.Add(UpdatePri);

                string ApplyNo  = PurchaseApplyM.ApplyNo;
                string FromType = PurchaseApplyM.FromType;

                #region 拓展属性
                SqlCommand cmd = new SqlCommand();
                GetExtAttrCmd(PurchaseApplyM, htExtAttr, cmd);
                if (htExtAttr.Count > 0)
                {
                    lstUpdate.Add(cmd);
                }
                #endregion


                //删除原来明细来源
                SqlCommand DelDtlS = PurchaseApplyDBHelper.DeleteDtlS(ApplyNo);
                lstUpdate.Add(DelDtlS);

                //插入现在的明细来源
                foreach (PurchaseApplyDetailSourceModel PurchaseApplyDetailSourceM in PurchaseApplyDetailSourceMList)
                {
                    SqlCommand AddDtlS = PurchaseApplyDBHelper.InsertDtlS(PurchaseApplyDetailSourceM, ApplyNo);
                    lstUpdate.Add(AddDtlS);
                }

                //删除原来明细
                SqlCommand DelDtl = PurchaseApplyDBHelper.DeleteDtl(ApplyNo);
                lstUpdate.Add(DelDtl);

                //插入现在的明细
                foreach (PurchaseApplyDetailModel PurchaseApplyDetailM in PurchaseApplyDetailMList)
                {
                    SqlCommand AddDtl = PurchaseApplyDBHelper.InsertDtl(PurchaseApplyDetailM, ApplyNo);
                    lstUpdate.Add(AddDtl);
                }


                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                //定义返回变量
                bool isSucc = false;

                /*
                 * 定义日志内容变量
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstUpdate);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }
                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                LogInfoModel logModel = InitLogInfo(ApplyNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return(isSucc);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 11
0
        public static bool InsertPurchaseApply(PurchaseApplyModel PurchaseApplyM, List <PurchaseApplyDetailSourceModel> PurchaseApplyDetailSourceMList
                                               , List <PurchaseApplyDetailModel> PurchaseApplyDetailMList, out int IndexIDentity, Hashtable htExtAttr)
        {
            ArrayList lstAdd = new ArrayList();

            //插入主表
            SqlCommand AddPri = PurchaseApplyDBHelper.InsertPrimary(PurchaseApplyM);

            lstAdd.Add(AddPri);

            string ApplyNo = PurchaseApplyM.ApplyNo;

            foreach (PurchaseApplyDetailSourceModel PurchaseApplyDetailSourceM in PurchaseApplyDetailSourceMList)
            {
                SqlCommand AddDtlS = PurchaseApplyDBHelper.InsertDtlS(PurchaseApplyDetailSourceM, ApplyNo);
                lstAdd.Add(AddDtlS);
            }
            foreach (PurchaseApplyDetailModel PurchaseApplyDetailM in PurchaseApplyDetailMList)
            {
                SqlCommand AddDtl = PurchaseApplyDBHelper.InsertDtl(PurchaseApplyDetailM, ApplyNo);
                lstAdd.Add(AddDtl);
            }
            #region 拓展属性
            SqlCommand cmd = new SqlCommand();
            GetExtAttrCmd(PurchaseApplyM, htExtAttr, cmd);
            if (htExtAttr.Count > 0)
            {
                lstAdd.Add(cmd);
            }
            #endregion


            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            //定义返回变量
            bool isSucc = false;

            /*
             * 定义日志内容变量
             * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
             * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
             */

            //执行插入操作
            try
            {
                isSucc = SqlHelper.ExecuteTransWithArrayList(lstAdd);
            }
            catch (Exception ex)
            {
                //输出日志
                WriteSystemLog(userInfo, ex);
            }


            //定义变量
            string remark;
            //成功时
            if (isSucc)
            {
                //设置操作成功标识
                remark        = ConstUtil.LOG_PROCESS_SUCCESS;
                IndexIDentity = int.Parse(((SqlCommand)AddPri).Parameters["@IndexID"].Value.ToString());
            }
            else
            {
                //设置操作成功标识
                remark        = ConstUtil.LOG_PROCESS_FAILED;
                IndexIDentity = 0;
            }

            LogInfoModel logModel = InitLogInfo(ApplyNo);
            //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
            logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
            //设置操作成功标识
            logModel.Remark = remark;

            //登陆日志
            LogDBHelper.InsertLog(logModel);
            return(isSucc);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 删除收款单
        /// </summary>
        /// <returns>true 成功,false失败</returns>
        public static bool DeleteIncomeBill(string ID, string BillingID, string Price)
        {
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            bool   isSucc       = false;
            string SetBillingID = string.Empty;

            try
            {
                isSucc = IncomeBillDBHelper.DeleteIncomeBill(ID, BillingID, Price);
                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }
                string[] noList = ID.Split(',');
                for (int i = 0; i < noList.Length; i++)
                {
                    //获取编号
                    string no = noList[i];
                    //替换两边的 '
                    no = no.Replace("'", string.Empty);
                    //操作日志
                    LogInfoModel logModel = InitLogInfo(no, 1);
                    //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                    logModel.Element = ConstUtil.LOG_PROCESS_DELETE;
                    //设置操作成功标识
                    logModel.Remark = remark;
                    //登陆日志
                    LogDBHelper.InsertLog(logModel);
                }

                if (isSucc)
                {
                    DataTable dt = BillingDBHelper.GetBillingYAccountsDT(BillingID);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow rows in dt.Rows)
                        {
                            if (Convert.ToDecimal(rows["YAccounts"]) == 0)
                            {
                                SetBillingID += rows["ID"].ToString() + ",";
                            }
                        }
                    }
                    //如果存在已付金额为0则更新结算状态
                    if (SetBillingID.Length > 0)
                    {
                        SetBillingID = SetBillingID.TrimEnd(new char[] { ',' });
                        isSucc       = BillingDBHelper.UpdateAccountStatusByID(SetBillingID, "0");
                    }
                }
                return(isSucc);
            }
            catch (Exception ex)
            {
                WriteSystemLog(userInfo, 1, ex);
                return(false);
            }
        }
Ejemplo n.º 13
0
        public static bool CancelConfirm(string ID, string PlanNo, List <ProductModel> ProductMList)
        {
            try
            {
                ArrayList lstCancelConfirm = new ArrayList();
                //更新主表
                lstCancelConfirm.Add(PurchasePlanDBHelper.CancelConfirm(ID));

                //回写采购申请中已计划数量
                if (ProductMList != null)
                {
                    foreach (ProductModel ProductM in ProductMList)
                    {
                        if (ProductM.FromType == "1")
                        {
                            SqlCommand DescPurApply = PurchasePlanDBHelper.WritePurchaseApplyDesc(ProductM);
                            lstCancelConfirm.Add(DescPurApply);
                        }
                        else if (ProductM.FromType == "2")
                        {
                            SqlCommand DesePurRequire = PurchasePlanDBHelper.WritePurchaseRequireDesc(ProductM);
                            lstCancelConfirm.Add(DesePurRequire);
                        }
                    }
                }
                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

                //撤销审批
                string    CompanyCD    = userInfo.CompanyCD;
                string    BillTypeFlag = ConstUtil.CODING_RULE_PURCHASE;
                string    BillTypeCode = ConstUtil.CODING_RULE_PURCHASE_PLAN;
                string    strUserID    = userInfo.UserID;;
                DataTable dt           = FlowDBHelper.GetFlowInstanceInfo(CompanyCD, Convert.ToInt32(BillTypeFlag), Convert.ToInt32(BillTypeCode), Convert.ToInt32(ID));
                if (dt.Rows.Count > 0)
                {
                    string FlowInstanceID = dt.Rows[0]["FlowInstanceID"].ToString();
                    string FlowStatus     = dt.Rows[0]["FlowStatus"].ToString();
                    string FlowNo         = dt.Rows[0]["FlowNo"].ToString();

                    lstCancelConfirm.Add(FlowDBHelper.CancelConfirmHis(CompanyCD, FlowInstanceID, FlowNo, BillTypeFlag, BillTypeCode, strUserID));
                    lstCancelConfirm.Add(FlowDBHelper.CancelConfirmTsk(CompanyCD, FlowInstanceID, strUserID));
                    lstCancelConfirm.Add(FlowDBHelper.CancelConfirmIns(CompanyCD, FlowNo, BillTypeFlag, BillTypeCode, ID, strUserID));
                }

                //定义返回变量
                bool isSucc = false;

                /*
                 * 定义日志内容变量
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstCancelConfirm);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }
                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                LogInfoModel logModel = InitLogInfo(PlanNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_UNCONFIRM;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return(isSucc);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 14
0
        public static bool ConfirmPurchasePlan(string ID, string No, List <ProductModel> ProductMList, out string Reason)
        {
            Reason = string.Empty;
            if (!PurchasePlanDBHelper.CanConfirmPurPlan(ID, out Reason))
            {
                return(false);
            }
            ArrayList lstConfirm = new ArrayList();

            //写确认人,确认时间
            lstConfirm.Add(PurchasePlanDBHelper.ConfirmPurchasePlan(ID));
            //回写采购申请
            if (ProductMList != null)
            {
                foreach (ProductModel ProductM in ProductMList)
                {
                    if (ProductM.FromType == "1")
                    {
                        lstConfirm.Add(PurchasePlanDBHelper.WritePurchaseApply(ProductM));
                    }
                    else if (ProductM.FromType == "2")
                    {
                        lstConfirm.Add(PurchasePlanDBHelper.WritePurchaseRequire(ProductM));
                    }
                }
            }

            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            //定义返回变量
            bool isSucc = false;

            /*
             * 定义日志内容变量
             * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
             * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
             */

            //执行插入操作
            try
            {
                isSucc = SqlHelper.ExecuteTransWithArrayList(lstConfirm);
            }
            catch (Exception ex)
            {
                //输出日志
                WriteSystemLog(userInfo, ex);
            }
            //定义变量
            string remark;

            //成功时
            if (isSucc)
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            else
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }

            LogInfoModel logModel = InitLogInfo(No);

            //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
            logModel.Element = ConstUtil.LOG_PROCESS_CONFIRM;
            //设置操作成功标识
            logModel.Remark = remark;

            //登陆日志
            LogDBHelper.InsertLog(logModel);
            return(isSucc);
        }
Ejemplo n.º 15
0
        public static bool ConfirmPuechaseOrder(string CompanyCD, string ID, string FromType, string OrderNo, out string Reason, List<ProductModel> ProductMList, List<ProductModel> ProductMStorList)
        {
            try
            {

                if (!PurchaseOrderDBHelper.CanConfirm(CompanyCD, OrderNo, int.Parse(ID), FromType, out Reason))
                    return false;
                ArrayList lstConfirm = new ArrayList();
                //写确认人,确认时间,单据状态
                lstConfirm.Add(PurchaseOrderDBHelper.ConfirmPurchaseOrder(ID));
                //回写合同表
                if (FromType == "4")
                {
                    foreach (ProductModel ProductM in ProductMList)
                    {
                        lstConfirm.Add(PurchaseOrderDBHelper.WritePurContract(ProductM));
                    }
                }
                else if (FromType == "2")
                {//回写计划表
                    foreach (ProductModel ProductM in ProductMList)
                    {
                        lstConfirm.Add(PurchaseOrderDBHelper.WritePurPlanConfirm(ProductM));
                    }
                }
                //回写库存分仓存量表
                foreach (ProductModel ProductM in ProductMStorList)
                {
                    lstConfirm.Add(PurchaseOrderDBHelper.WriteStorge(ProductM));
                }

                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                //定义返回变量
                bool isSucc = false;
                /* 
                 * 定义日志内容变量 
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstConfirm);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }
                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识 
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                LogInfoModel logModel = InitLogInfo(OrderNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_CONFIRM;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return isSucc;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 16
0
        public static bool UpdateSubSellOrder(SubSellOrderModel SubSellOrderM, List <SubSellOrderDetailModel> SubSellOrderDetailMList, Hashtable htExtAttr)
        {
            ArrayList lstUpdate = new ArrayList();
            //更新主表
            SqlCommand UpdatePri = SubSellOrderDBHelper.UpdateSubSellOrder(SubSellOrderM);

            lstUpdate.Add(UpdatePri);

            // 更新扩展属性
            SqlCommand commExtAttr = SubSellOrderDBHelper.UpdateExtAttr(SubSellOrderM, htExtAttr);

            if (commExtAttr != null)
            {
                lstUpdate.Add(commExtAttr);
            }

            //删除明细
            SqlCommand DeleteDetail = SubSellOrderDBHelper.DeleteSubSellOrderDetail(SubSellOrderM.OrderNo);

            lstUpdate.Add(DeleteDetail);
            //新增明细
            foreach (SubSellOrderDetailModel SubSellOrderDetailM in SubSellOrderDetailMList)
            {
                SqlCommand AddDetail = SubSellOrderDBHelper.InsertSubSellOrderDetail(SubSellOrderDetailM);
                lstUpdate.Add(AddDetail);
            }

            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            //定义返回变量
            bool isSucc = false;

            /*
             * 定义日志内容变量
             * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
             * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
             */

            //执行插入操作
            try
            {
                isSucc = SqlHelper.ExecuteTransWithArrayList(lstUpdate);
            }
            catch (Exception ex)
            {
                //输出日志
                WriteSystemLog(userInfo, ex);
            }
            //定义变量
            string remark;

            //成功时
            if (isSucc)
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            else
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }

            LogInfoModel logModel = InitLogInfo(SubSellOrderM.OrderNo);

            //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
            logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
            //设置操作成功标识
            logModel.Remark = remark;

            //登陆日志
            LogDBHelper.InsertLog(logModel);
            return(isSucc);
        }
Ejemplo n.º 17
0
        public static bool ConcelConfirm(string ID, string FromType, string OrderNo, List<ProductModel> ProductMList, List<ProductModel> ProductMStorList, out string Reason)
        {
            try
            {
                Reason = string.Empty;
                //不可以确认返回false
                if (!PurchaseOrderDBHelper.CanConcel(ID, out Reason))
                    return false;
                ArrayList lstConcelConfirm = new ArrayList();
                //更新主表
                SqlCommand ConcelPri = PurchaseOrderDBHelper.ConcelConfirm(ID);
                lstConcelConfirm.Add(ConcelPri);

                //更新分仓存量表
                if (ProductMStorList != null)
                {
                    foreach (ProductModel ProductM in ProductMStorList)
                    {
                        SqlCommand comm = PurchaseOrderDBHelper.WriteStorgeDecr(ProductM);
                        lstConcelConfirm.Add(comm);
                    }
                }
                if (ProductMList != null)
                {
                    if (FromType == "2")
                    {//回写采购计划
                        foreach (ProductModel ProductM in ProductMList)
                        {
                            SqlCommand comm = PurchaseOrderDBHelper.WritePurPlanDecr(ProductM);
                            lstConcelConfirm.Add(comm);
                        }
                    }
                    else if (FromType == "4")
                    {//回写采购合同
                        foreach (ProductModel ProductM in ProductMList)
                        {
                            SqlCommand comm = PurchaseOrderDBHelper.WritePurContDecr(ProductM);
                            lstConcelConfirm.Add(comm);
                        }
                    }
                }
                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

                //撤销审批
                string CompanyCD = userInfo.CompanyCD;
                string BillTypeFlag = ConstUtil.CODING_RULE_PURCHASE;
                string BillTypeCode = ConstUtil.CODING_RULE_PURCHASE_ORDER;
                string strUserID = userInfo.UserID; ;
                DataTable dt = FlowDBHelper.GetFlowInstanceInfo(CompanyCD, Convert.ToInt32(BillTypeFlag), Convert.ToInt32(BillTypeCode), Convert.ToInt32(ID));
                if (dt.Rows.Count > 0)
                {
                    string FlowInstanceID = dt.Rows[0]["FlowInstanceID"].ToString();
                    string FlowStatus = dt.Rows[0]["FlowStatus"].ToString();
                    string FlowNo = dt.Rows[0]["FlowNo"].ToString();

                    lstConcelConfirm.Add(FlowDBHelper.CancelConfirmHis(CompanyCD, FlowInstanceID, FlowNo, BillTypeFlag, BillTypeCode, strUserID));
                    lstConcelConfirm.Add(FlowDBHelper.CancelConfirmTsk(CompanyCD, FlowInstanceID, strUserID));
                    lstConcelConfirm.Add(FlowDBHelper.CancelConfirmIns(CompanyCD, FlowNo, BillTypeFlag, BillTypeCode, ID, strUserID));
                }

                //定义返回变量
                bool isSucc = false;
                /* 
                 * 定义日志内容变量 
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstConcelConfirm);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }
                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识 
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                LogInfoModel logModel = InitLogInfo(OrderNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_UNCONFIRM;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return isSucc;
            }
            catch (Exception ex)
            {
                throw ex;
            }



        }
Ejemplo n.º 18
0
        public static bool InsertSubSellOrder(SubSellOrderModel SubSellOrderM, List <SubSellOrderDetailModel> SubSellOrderDetailMList, out int IndexIDentity, Hashtable htExtAttr)
        {
            ArrayList lstAdd = new ArrayList();

            //主表新增
            SqlCommand AddPri = SubSellOrderDBHelper.InsertSubSellOrder(SubSellOrderM);

            lstAdd.Add(AddPri);

            // 更新扩展属性
            SqlCommand commExtAttr = SubSellOrderDBHelper.UpdateExtAttr(SubSellOrderM, htExtAttr);

            if (commExtAttr != null)
            {
                lstAdd.Add(commExtAttr);
            }

            //明细表新增
            foreach (SubSellOrderDetailModel SubSellOrderDetailM in SubSellOrderDetailMList)
            {
                SqlCommand AddDtl = SubSellOrderDBHelper.InsertSubSellOrderDetail(SubSellOrderDetailM);
                lstAdd.Add(AddDtl);
            }

            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            //定义返回变量
            bool isSucc = false;

            /*
             * 定义日志内容变量
             * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
             * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
             */

            //执行插入操作
            try
            {
                isSucc = SqlHelper.ExecuteTransWithArrayList(lstAdd);
            }
            catch (Exception ex)
            {
                //输出日志
                WriteSystemLog(userInfo, ex);
            }


            //定义变量
            string remark;

            //成功时
            if (isSucc)
            {
                //设置操作成功标识
                remark        = ConstUtil.LOG_PROCESS_SUCCESS;
                IndexIDentity = int.Parse(((SqlCommand)AddPri).Parameters["@IndexID"].Value.ToString());
            }
            else
            {
                //设置操作成功标识
                remark        = ConstUtil.LOG_PROCESS_FAILED;
                IndexIDentity = 0;
            }

            LogInfoModel logModel = InitLogInfo(SubSellOrderM.OrderNo);

            //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
            logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
            //设置操作成功标识
            logModel.Remark = remark;

            //登陆日志
            LogDBHelper.InsertLog(logModel);
            return(isSucc);
        }
Ejemplo n.º 19
0
        public static bool SaveRectCheckElemInfo(PerformanceTypeModel model)
        {
            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //设置公司代码
            model.CompanyCD = userInfo.CompanyCD;
            //设置最后修改者
            model.ModifiedUserID = userInfo.UserID;
            //设置创建者的编号
            model.CreateUser = userInfo.EmployeeID;
            //定义返回变量
            bool isSucc = false;
            //操作日志
            LogInfoModel logModel = InitLogInfo(model.ID);

            //更新
            if (ConstUtil.EDIT_FLAG_UPDATE.Equals(model.EditFlag))
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                    //执行更新操作
                    isSucc = PerformanceTypeDBhelper.UpdatePerformanceType(model);
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //插入
            else
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                    //执行插入操作
                    isSucc            = PerformanceTypeDBhelper.InsertPerformanceType(model);
                    logModel.ObjectID = model.ID;
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //更新成功时
            if (isSucc)
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            //更新不成功
            else
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
            }

            //登陆日志
            LogDBHelper.InsertLog(logModel);

            return(isSucc);
        }
Ejemplo n.º 20
0
        //需要插入客户
        public static bool ConfirmSubSellOrder(string ID, string No, SubSellCustInfoModel SubSellCustInfoM)
        {
            ArrayList lstConfirm = new ArrayList();

            //单据确认人,确认时间,单据状态,业务状态
            SqlCommand Confirm = SubSellOrderDBHelper.ConfirmSubSellOrder(ID);

            lstConfirm.Add(Confirm);

            //新增客户信息
            SqlCommand AddCust = SubSellOrderDBHelper.InsertCustInfo(SubSellCustInfoM);

            lstConfirm.Add(AddCust);

            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            //定义返回变量
            bool isSucc = false;

            /*
             * 定义日志内容变量
             * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
             * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
             */

            //执行插入操作
            try
            {
                isSucc = SqlHelper.ExecuteTransWithArrayList(lstConfirm);
            }
            catch (Exception ex)
            {
                //输出日志
                WriteSystemLog(userInfo, ex);
            }
            //定义变量
            string remark;

            //成功时
            if (isSucc)
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            else
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }

            LogInfoModel logModel = InitLogInfo(No);

            //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
            logModel.Element = ConstUtil.LOG_PROCESS_CONFIRM;
            //设置操作成功标识
            logModel.Remark = remark;

            //登陆日志
            LogDBHelper.InsertLog(logModel);
            return(isSucc);
        }
Ejemplo n.º 21
0
        public static string DelStorageReturn(string[] ID)
        {
            bool flag = false;

            //string res = string.Empty;

            /*
             * 定义日志内容变量
             * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
             * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
             */
            //获取当前用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //执行操作
            try
            {
                //执行操作
                flag = XBase.Data.Office.StorageManager.StorageReturnDBHelper.DelStorageReturn(ID);
            }
            catch (Exception ex)
            {
                //输出日志
                WriteSystemLog(userInfo, ex);
            }
            //定义变量
            string remark;

            //成功时
            if (flag)
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            else
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            string idInfo = string.Empty;

            foreach (string str in ID)
            {
                idInfo += str + ",";
            }
            //操作日志
            LogInfoModel logModel = InitLogInfo(idInfo);

            //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
            logModel.Element = ConstUtil.LOG_PROCESS_DELETE;
            //设置操作成功标识
            logModel.Remark = remark;

            //登陆日志
            LogDBHelper.InsertLog(logModel);

            if (flag)
            {
                return("2");
            }
            else
            {
                return("1");
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 确认
        /// </summary>
        /// <param name="SubSellOrderM"></param>
        /// <param name="SubSellOrderDetailMList"></param>
        /// <returns></returns>
        public static bool ConfirmOutSubSellOrder(SubSellOrderModel SubSellOrderM, List <SubSellOrderDetailModel> SubSellOrderDetailMList)
        {
            try
            {
                ArrayList    lstConfirm = new ArrayList();
                UserInfoUtil userInfo   = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                int          id         = 0;
                decimal      count      = 0m;
                if (SubSellOrderM.SendMode == "1")
                {//分店发货
                    //确认时,更新分店存量表
                    foreach (SubSellOrderDetailModel SubSellOrderDetailM in SubSellOrderDetailMList)
                    {
                        #region 添加门店库存流水帐
                        SubStorageAccountModel aModel = new SubStorageAccountModel();
                        aModel.BatchNo   = SubSellOrderDetailM.BatchNo;
                        aModel.BillNo    = SubSellOrderM.OrderNo;
                        aModel.BillType  = 3;
                        aModel.CompanyCD = SubSellOrderDetailM.CompanyCD;
                        aModel.PageUrl   = "";
                        if (int.TryParse(SubSellOrderM.Creator, out id))
                        {
                            aModel.Creator = id;
                        }
                        if (int.TryParse(SubSellOrderM.DeptID, out id))
                        {
                            aModel.DeptID = id;
                        }
                        aModel.HappenDate = DateTime.Now;
                        if (int.TryParse(SubSellOrderDetailM.ProductID, out id))
                        {
                            aModel.ProductID = id;
                        }
                        if (decimal.TryParse(SubSellOrderDetailM.UnitPrice, out count))
                        {
                            aModel.Price = count;
                        }
                        if (decimal.TryParse(SubSellOrderDetailM.ProductCount, out count))
                        {
                            aModel.HappenCount = -count;
                        }
                        aModel.PageUrl = SubSellOrderM.Remark;
                        lstConfirm.Add(XBase.Data.Office.SubStoreManager.SubStorageAccountDBHelper.GetCountAndInsertCommand(aModel));
                        #endregion

                        lstConfirm.Add(XBase.Data.Office.LogisticsDistributionManager.StorageProductQueryDBHelper.UpdateProductCount(userInfo.CompanyCD
                                                                                                                                     , SubSellOrderDetailM.ProductID, SubSellOrderM.DeptID, SubSellOrderDetailM.BatchNo, -count));
                    }
                }
                else if (SubSellOrderM.SendMode == "2")
                {//总部发货
                    //确认时更新分仓存量表
                    foreach (SubSellOrderDetailModel SubSellOrderDetailM in SubSellOrderDetailMList)
                    {
                        #region 添加库存流水帐

                        XBase.Model.Office.StorageManager.StorageAccountModel sModel = new XBase.Model.Office.StorageManager.StorageAccountModel();
                        sModel.BatchNo   = SubSellOrderDetailM.BatchNo;
                        sModel.BillNo    = SubSellOrderM.OrderNo;
                        sModel.BillType  = 21;
                        sModel.CompanyCD = SubSellOrderDetailM.CompanyCD;
                        if (int.TryParse(SubSellOrderDetailM.StorageID, out id))
                        {
                            sModel.StorageID = id;
                        }
                        if (int.TryParse(SubSellOrderM.Creator, out id))
                        {
                            sModel.Creator = id;
                        }
                        if (int.TryParse(SubSellOrderDetailM.ProductID, out id))
                        {
                            sModel.ProductID = id;
                        }
                        if (decimal.TryParse(SubSellOrderDetailM.UnitPrice, out count))
                        {
                            sModel.Price = count;
                        }
                        if (decimal.TryParse(SubSellOrderDetailM.ProductCount, out count))
                        {
                            sModel.HappenCount = count;
                        }
                        sModel.HappenDate = DateTime.Now;
                        sModel.PageUrl    = SubSellOrderM.Remark;
                        lstConfirm.Add(XBase.Data.Office.StorageManager.StorageAccountDBHelper.InsertStorageAccountCommand(sModel, "1"));

                        #endregion

                        // 更新库存
                        lstConfirm.Add(XBase.Data.Office.StorageManager.StorageSearchDBHelper.UpdateProductCount(userInfo.CompanyCD
                                                                                                                 , SubSellOrderDetailM.ProductID, SubSellOrderDetailM.StorageID
                                                                                                                 , SubSellOrderDetailM.BatchNo, -count));
                    }
                }

                //更新发货信息和安装信息
                lstConfirm.Add(SubSellOrderDBHelper.ConfirmOutSubSellOrder(SubSellOrderM));

                //获取登陆用户信息
                //UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                //定义返回变量
                bool isSucc = false;

                /*
                 * 定义日志内容变量
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstConfirm);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }
                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                LogInfoModel logModel = InitLogInfo(SubSellOrderM.OrderNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_OUT;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return(isSucc);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 编辑招聘活动信息
        /// </summary>
        /// <param name="model">招聘申请活动</param>
        /// <returns></returns>
        public static bool SaveRectPlanInfo(RectPlanModel model)
        {
            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //设置公司代码
            model.CompanyCD      = userInfo.CompanyCD;
            model.ModifiedUserID = userInfo.UserID;
            //定义返回变量
            bool isSucc = false;
            //操作日志
            LogInfoModel logModel = InitLogInfo(model.PlanNo);

            //更新
            if (ConstUtil.EDIT_FLAG_UPDATE.Equals(model.EditFlag))
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                    //执行更新操作
                    isSucc = RectPlanDBHelper.UpdateRectPlanInfo(model);
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //插入
            else
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                    //执行插入操作
                    isSucc = RectPlanDBHelper.InsertRectPlanInfo(model);
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //更新成功时
            if (isSucc)
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            //更新不成功
            else
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
            }

            //登陆日志
            LogDBHelper.InsertLog(logModel);

            return(isSucc);
        }
Ejemplo n.º 24
0
        public static bool InsertPurchaseOrder(PurchaseOrderModel PurchaseOrderM, List<PurchaseOrderDetailModel> PurchaseOrderDetailMList, out int IndexIDentity, out string Reason, Hashtable htExtAttr)
        {
            try
            {
                IndexIDentity = 0;
                //判断引用源单数量有没有超过,超过了就不让保存
                if (!PurchaseOrderDBHelper.CanSave(PurchaseOrderDetailMList, out Reason))
                    return false;
                ArrayList lstAdd = new ArrayList();
                //插入主表
                SqlCommand AddPri = PurchaseOrderDBHelper.InsertPurchaseOrder(PurchaseOrderM);
                lstAdd.Add(AddPri);
                string OrderNo = PurchaseOrderM.OrderNo;
                //插入明细
                foreach (PurchaseOrderDetailModel PurchaseOrderDetailM in PurchaseOrderDetailMList)
                {
                    SqlCommand AddDetail = PurchaseOrderDBHelper.InsertPurchaseOrderDetail(PurchaseOrderDetailM, OrderNo);
                    lstAdd.Add(AddDetail);
                }
                #region 拓展属性
                SqlCommand cmd = new SqlCommand();
                GetExtAttrCmd(PurchaseOrderM, htExtAttr, cmd);
                if (htExtAttr.Count > 0)
                    lstAdd.Add(cmd);
                #endregion
                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                //定义返回变量
                bool isSucc = false;
                /* 
                 * 定义日志内容变量 
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstAdd);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }


                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                    IndexIDentity = int.Parse(((SqlCommand)AddPri).Parameters["@IndexID"].Value.ToString());
                }
                else
                {
                    //设置操作成功标识 
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                    IndexIDentity = 0;
                }

                LogInfoModel logModel = InitLogInfo(OrderNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return isSucc;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 25
0
        public static bool UpdateStatus(SubDeliveryBack model, int stype)
        {
            //定义返回变量
            bool res = false;

            /*
             * 定义日志内容变量
             * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
             * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
             */
            //获取当前用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //执行操作
            try
            {
                //执行操作
                res = XBase.Data.Office.LogisticsDistributionManager.SubDeliveryBackDBHelper.UpdateStatus(model, stype);
            }
            catch (Exception ex)
            {
                //输出日志
                WriteSystemLog(userInfo, ex);
            }
            //定义变量
            string remark;

            //成功时
            if (res)
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            else
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            //操作日志
            LogInfoModel logModel = InitLogInfo(model.BackNo);
            //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空

            string msg = string.Empty;

            switch (stype)
            {
            case 1:
                /*确认*/
                msg = ConstUtil.LOG_PROCESS_CONFIRM;
                break;

            case 2:
                /*结单*/
                msg = ConstUtil.LOG_PROCESS_COMPLETE;
                break;

            case 3:
                /*取消结单*/
                msg = ConstUtil.LOG_PROCESS_CONCELCOMPLETE;
                break;

            case 4:
                /*取消确认*/
                msg = ConstUtil.LOG_PROCESS_UNCONFIRM;
                break;
            }
            logModel.Element = msg;

            //设置操作成功标识
            logModel.Remark = remark;

            //登陆日志
            LogDBHelper.InsertLog(logModel);

            return(res);
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 更新采购订单
        /// </summary>
        /// <param name="PurchaseOrderM">主表model</param>
        /// <param name="PurchaseOrderDetailMList">明细表modellist</param>
        /// <param name="ProductMStorList">用于回写库存的物品modellist</param>
        /// <param name="ProductMList">用于回写计划或是合同的物品modellist</param>
        /// <returns>DataTable</returns>
        public static bool UpdatePurchaseOrder(PurchaseOrderModel PurchaseOrderM, List<PurchaseOrderDetailModel> PurchaseOrderDetailMList
            , List<ProductModel> ProductMStorList, List<ProductModel> ProductMList, out string Reason, Hashtable htExtAttr)
        {
            try
            {
                //判断引用源单数量有没有超过,超过了就不让保存
                if (!PurchaseOrderDBHelper.CanSave(PurchaseOrderDetailMList, out Reason))
                    return false;
                //判断该单据有没有确认


                //判断该单据是不是可以确认,包括引用的源单数量是不是合法,有没有到达库存报警上限



                ArrayList lstUpdate = new ArrayList();

                //更新主表
                SqlCommand UpdatePri = PurchaseOrderDBHelper.UpdatePurchaseOrder(PurchaseOrderM);
                lstUpdate.Add(UpdatePri);
                #region 拓展属性
                SqlCommand cmd = new SqlCommand();
                GetExtAttrCmd(PurchaseOrderM, htExtAttr, cmd);
                if (htExtAttr.Count > 0)
                    lstUpdate.Add(cmd);
                #endregion

                string OrderNo = PurchaseOrderM.OrderNo;
                //删除明细
                SqlCommand DeleteDetail = PurchaseOrderDBHelper.DeletePurchaseOrderDetailSingle(OrderNo);
                lstUpdate.Add(DeleteDetail);

                //插入明细
                foreach (PurchaseOrderDetailModel PurchaseOrderDetailM in PurchaseOrderDetailMList)
                {
                    SqlCommand AddDetail = PurchaseOrderDBHelper.InsertPurchaseOrderDetail(PurchaseOrderDetailM, OrderNo);
                    lstUpdate.Add(AddDetail);
                }
                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                //定义返回变量
                bool isSucc = false;
                /* 
                 * 定义日志内容变量 
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstUpdate);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }
                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识 
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                LogInfoModel logModel = InitLogInfo(OrderNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return isSucc;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 编辑面试记录信息
        /// </summary>
        /// <param name="model">面试记录信息</param>
        /// <returns></returns>
        public static bool SaveInterviewInfo(RectInterviewModel model)
        {
            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //设置公司代码
            model.CompanyCD      = userInfo.CompanyCD;
            model.ModifiedUserID = userInfo.UserID;
            //定义返回变量
            bool isSucc = false;
            //操作日志
            LogInfoModel logModel = InitLogInfo(model.InterviewNo);

            //更新
            if (!string.IsNullOrEmpty(model.ID))
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                    //执行更新操作
                    isSucc = RectInterviewDBHelper.UpdateInterviewInfo(model);
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //插入
            else
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                    //执行插入操作
                    isSucc = RectInterviewDBHelper.InsertInterviewInfo(model);
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //更新成功时
            if (isSucc)
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            //更新不成功
            else
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
            }

            //登陆日志
            LogDBHelper.InsertLog(logModel);

            return(isSucc);
        }
Ejemplo n.º 28
0
        public static bool DeletePurchaseOrder(string IDs, string OrderNos)
        {
            try
            {
                ArrayList lstDelete = new ArrayList();
                SqlCommand DelPri = PurchaseOrderDBHelper.DeletePurchaseOrder(IDs);
                lstDelete.Add(DelPri);
                SqlCommand DelDtl = PurchaseOrderDBHelper.DeletePurchaseOrderDetail(OrderNos);
                lstDelete.Add(DelDtl);

                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                //定义返回变量
                bool isSucc = false;
                /* 
                 * 定义日志内容变量 
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行删除操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstDelete);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }


                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识 
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                //获取删除的编号列表
                string[] noList = OrderNos.Split(',');
                //遍历所有编号,登陆操作日志
                for (int i = 0; i < noList.Length; i++)
                {
                    //获取编号
                    string no = noList[i];
                    //替换两边的 '
                    no = no.Replace("'", string.Empty);

                    //操作日志
                    LogInfoModel logModel = InitLogInfo(no);
                    //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                    logModel.Element = ConstUtil.LOG_PROCESS_DELETE;
                    //设置操作成功标识
                    logModel.Remark = remark;

                    //登陆日志
                    LogDBHelper.InsertLog(logModel);
                }
                return isSucc;

            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
Ejemplo n.º 29
0
        /// <summary>
        /// 根据会议室ID修改会议室信息
        /// </summary>
        /// <param name="MeetingRoomM">会议室信息</param>
        /// <returns>bool值</returns>
        public static bool UpdateMeetingRoom(MeetingRoomModel MeetingRoomM)
        {
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            LogInfoModel logModel = new LogInfoModel(); //操作日志
            bool         isSucc   = false;              //定义返回变量

            #region 设置操作日志内容
            //设置公司代码
            logModel.CompanyCD = userInfo.CompanyCD;
            //设置登陆用户ID
            logModel.UserID = userInfo.UserID;
            //设置模块ID 模块ID在ConstUtil中定义,以便维护
            logModel.ModuleID = ConstUtil.MODULE_ID_MEETINGROOM_LIST;
            //操作单据编号 会议室名称
            logModel.ObjectID = MeetingRoomM.RoomName;
            //操作对象 操作的表信息
            logModel.ObjectName = ConstUtil.TABLE_NAME_DOC;
            //涉及关键元素 涉及其他业务、表关系
            logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
            //备注 操作类型
            logModel.Remark = ConstUtil.LOG_PROCESS_UPDATE;
            #endregion

            try
            {
                isSucc = MeetingRoomDBHelper.UpdateMeetingRoom(MeetingRoomM);
            }
            catch (System.Exception ex)
            {
                #region  操作失败时记录日志到文件
                //定义变量
                LogInfo logSys = new LogInfo();
                //设置日志类型 需要指定为系统日志
                logSys.Type = LogInfo.LogType.SYSTEM;
                //指定系统日志类型 出错信息
                logSys.SystemKind = LogInfo.SystemLogKind.SYSTEM_ERROR;
                //指定登陆用户信息
                logSys.UserInfo = userInfo;
                //设定模块ID
                logSys.ModuleID = ConstUtil.MODULE_ID_MEETINGROOM_LIST;
                //描述
                logSys.Description = ex.ToString();
                //输出日志
                LogUtil.WriteLog(logSys);
                #endregion
            }

            if (isSucc)//操作成功
            {
                logModel.Remark += "成功";
            }
            else//操作失败
            {
                logModel.Remark += "失败";
            }

            //记录日志
            LogDBHelper.InsertLog(logModel);

            return(isSucc);
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 修改合同记录
        /// </summary>
        /// <param name="CompanyCD"></param>
        /// <param name="CompanyNo"></param>
        /// <returns></returns>
        public static bool UpdatePurchaseContract(PurchaseContractModel model, string DetailProductID, string DetailProductNo, string DetailProductName, string DetailUnitID, string DetailProductCount, string DetailUnitPrice, string DetailTaxPrice, string DetailDiscount, string DetailTaxRate, string DetailTotalPrice, string DetailTotalFee, string DetailTotalTax, string DetailRequireDate, string DetailApplyReason, string DetailRemark, string DetailFromBillID, string DetailFromBillNo, string DetailFromLineNo, string DetailUsedUnitID, string DetailUsedUnitCount, string DetailUsedPrice, string DetailExRate, string length, string fflag2, string no, Hashtable ht)
        {
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            if (model.ID <= 0)
            {
                return(false);
            }
            try
            {
                bool         succ     = false;
                LogInfoModel logModel = InitLogInfo(no);
                logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                //设置模块ID 模块ID请在ConstUtil中定义,以便维护
                logModel.ModuleID = ConstUtil.MODULE_ID_PurchaseContract_Add;
                succ = PurchaseContractDBHelper.UpdatePurchaseContract(model, DetailProductID, DetailProductNo, DetailProductName, DetailUnitID, DetailProductCount, DetailUnitPrice, DetailTaxPrice, DetailDiscount, DetailTaxRate, DetailTotalPrice, DetailTotalFee, DetailTotalTax, DetailRequireDate, DetailApplyReason, DetailRemark, DetailFromBillID, DetailFromBillNo, DetailFromLineNo, DetailUsedUnitID, DetailUsedUnitCount, DetailUsedPrice, DetailExRate, length, fflag2, no, ht);
                if (!succ)
                {
                    logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
                }
                else
                {
                    logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                LogDBHelper.InsertLog(logModel);
                return(succ);
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
            #region
            //if (model.CompanyCD == null) model.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
            ////string CompanyCD = "AAAAAA";
            ////try
            ////{
            ////    return PurchaseContractDBHelper.UpdatePurchaseContract(sql);
            ////}
            ////catch (Exception ex)
            ////{
            ////    throw ex;
            ////}

            //try
            //{
            //    SqlDateTime signdate = model.SignDate == null ? SqlDateTime.Null : SqlDateTime.Parse(model.SignDate.ToString());
            //    SqlDateTime confirmdate = model.ConfirmDate == null ? SqlDateTime.Null : SqlDateTime.Parse(model.ConfirmDate.ToString());
            //    SqlDateTime closedate = model.CloseDate == null ? SqlDateTime.Null : SqlDateTime.Parse(model.CloseDate.ToString());
            //    SqlDateTime createdate = model.CreateDate == null ? SqlDateTime.Null : SqlDateTime.Parse(model.CreateDate.ToString());
            //    int Creator = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeID;
            //    #region 采购合同更新SQL语句
            //    StringBuilder sqlc = new StringBuilder();
            //    sqlc.AppendLine(" UPDATE officedba.PurchaseContract SET ");
            //    sqlc.AppendLine(" CompanyCD          ='" + model.CompanyCD + "',");
            //    sqlc.AppendLine(" ContractNo         ='" + no + "',");
            //    sqlc.AppendLine(" Title              ='" + model.Title + "',");
            //    sqlc.AppendLine(" ProviderID         =" + model.ProviderID + ",");
            //    sqlc.AppendLine(" FromType           ='" + model.FromType + "',");
            //    sqlc.AppendLine(" FromBillID         =" + model.FromBillID + ",");
            //    sqlc.AppendLine(" TotalPrice         =" + model.TotalPrice + ",");
            //    sqlc.AppendLine(" CurrencyType       =" + model.CurrencyType + ",");
            //    sqlc.AppendLine(" Rate               =" + model.Rate + ",");
            //    sqlc.AppendLine(" PayType            =" + model.PayType + ",");
            //    if (signdate.IsNull)
            //    {
            //        sqlc.AppendLine("SignDate        = " + signdate + ",");
            //    }
            //    else
            //    {
            //        sqlc.AppendLine("SignDate       = '" + signdate + "',");
            //    }
            //    sqlc.AppendLine(" Seller            =" + model.Seller + ",");
            //    sqlc.AppendLine(" TheyDelegate   ='" + model.TheyDelegate + "',");
            //    sqlc.AppendLine(" OurDelegate         =" + model.OurDelegate + ",");
            //    sqlc.AppendLine(" Status            ='" + model.Status + "',");
            //    sqlc.AppendLine(" Note              ='" + model.Note + "',");
            //    sqlc.AppendLine(" TakeType          =" + model.TakeType + ",");
            //    sqlc.AppendLine(" CarryType         =" + model.CarryType + ",");
            //    sqlc.AppendLine(" Attachment        ='" + model.Attachment + "',");
            //    sqlc.AppendLine(" remark            ='" + model.remark + "',");
            //    sqlc.AppendLine(" BillStatus        ='" + model.BillStatus + "',");
            //    sqlc.AppendLine(" Creator           =" + model.Creator + ",");
            //    if (createdate.IsNull)
            //    {
            //        sqlc.AppendLine("CreateDate     = " + createdate + ",");
            //    }
            //    else
            //    {
            //        sqlc.AppendLine("CreateDate     = '" + createdate + "',");
            //    }
            //    sqlc.AppendLine(" ModifiedDate      =getdate(),");
            //    sqlc.AppendLine(" ModifiedUserID    ='" + model.ModifiedUserID + "',");
            //    sqlc.AppendLine(" Confirmor         =" + model.Confirmor + ",");
            //    if (confirmdate.IsNull)
            //    {
            //        sqlc.AppendLine("Confirmdate     = " + confirmdate + ",");
            //    }
            //    else
            //    {
            //        sqlc.AppendLine("Confirmdate     = '" + confirmdate + "',");
            //    }
            //    sqlc.AppendLine(" Closer            =" + Creator + ",");
            //    if (closedate.IsNull)
            //    {
            //        sqlc.AppendLine("CloseDate      =" + closedate + ",");
            //    }
            //    else
            //    {
            //        sqlc.AppendLine("CloseDate      ='" + closedate + "',");
            //    }
            //    sqlc.AppendLine("DeptID             =" + model.DeptID + ",");
            //    sqlc.AppendLine("TotalTax             =" + model.TotalTax + ",");
            //    sqlc.AppendLine("TotalFee             =" + model.TotalFee + ",");
            //    sqlc.AppendLine("Discount             =" + model.Discount + ",");
            //    sqlc.AppendLine("DiscountTotal             =" + model.DiscountTotal + ",");
            //    sqlc.AppendLine("RealTotal             =" + model.RealTotal + ",");
            //    sqlc.AppendLine("isAddTax             ='" + model.isAddTax + "',");
            //    sqlc.AppendLine("CountTotal             =" + model.CountTotal + ",");
            //    sqlc.AppendLine("TypeID             =" + model.TypeID + ",");
            //    sqlc.AppendLine("SignAddr             ='" + model.SignAddr + "',");
            //    sqlc.AppendLine("MoneyType             =" + model.MoneyType + "");
            //    sqlc.AppendLine(" Where  CompanyCD='" + model.CompanyCD + "' and ContractNo='" + no+"' ");

            //    #endregion

            //    //如果未别引用,明细操作
            //    string[] sql = null;
            //    int lengs = Convert.ToInt32(length);
            //    if (lengs > 0)
            //    {
            //        sql = new string[lengs + 2];
            //        sql[0] = sqlc.ToString();
            //        sql[1] = "delete from officedba.PurchaseContractDetail where CompanyCD='" + model.CompanyCD + "' and ContractNo='" + no + "' ";
            //        string[] ProductID = DetailProductID.Split(',');
            //        string[] ProductNo = DetailProductNo.Split(',');
            //        string[] ProductName = DetailProductName.Split(',');
            //        string[] Standard = DetailStandard.Split(',');//规格
            //        string[] UnitID = DetailUnitID.Split(',');
            //        string[] ProductCount = DetailProductCount.Split(',');
            //        string[] UnitPrice = DetailUnitPrice.Split(',');//单价
            //        string[] TaxPrice = DetailTaxPrice.Split(',');//含税价
            //        string[] Discount = DetailDiscount.Split(',');//折扣
            //        string[] TaxRate = DetailTaxRate.Split(',');//税率
            //        string[] TotalPrice = DetailTotalPrice.Split(',');//金额
            //        string[] TotalFee = DetailTotalFee.Split(',');//含税金额
            //        string[] TotalTax = DetailTotalTax.Split(',');//税额
            //        string[] RequireDate = DetailRequireDate.Split(',');
            //        string[] ApplyReason = DetailApplyReason.Split(',');
            //        string[] Remark = DetailRemark.Split(',');
            //        string[] FromBillID = DetailFromBillID.Split(',');
            //        string[] FromLineNo = DetailFromLineNo.Split(',');
            //        for (int i = 2; i <= lengs + 1; i++)
            //        {
            //            SqlDateTime mRequireDate;
            //            decimal mTotalPrice, mUnitID;
            //            decimal mUnitPrice, mProductCount, mTaxPrice, mDiscount, mTaxRate, mTotalFee, mTotalTax;
            //            if (UnitPrice[i - 2].ToString() == "")
            //            {
            //                mUnitPrice = 0;
            //            }
            //            else
            //            {
            //                mUnitPrice = Convert.ToDecimal(UnitPrice[i - 2].ToString());
            //            }
            //            if (ProductCount[i - 2].ToString() == "")
            //            {
            //                mProductCount = 0;
            //            }
            //            else
            //            {
            //                mProductCount = Convert.ToDecimal(ProductCount[i - 2].ToString());
            //            }
            //            if (TotalPrice[i - 2].ToString() == "")
            //            {
            //                mTotalPrice = 0;
            //            }
            //            else
            //            {
            //                mTotalPrice = Convert.ToDecimal(TotalPrice[i - 2].ToString());
            //            }
            //            if (TaxPrice[i - 2].ToString() == "")
            //            {
            //                mTaxPrice = 0;
            //            }
            //            else
            //            {
            //                mTaxPrice = Convert.ToDecimal(TaxPrice[i - 2].ToString());
            //            }
            //            if (Discount[i - 2].ToString() == "")
            //            {
            //                mDiscount = 0;
            //            }
            //            else
            //            {
            //                mDiscount = Convert.ToDecimal(Discount[i - 2].ToString());
            //            }
            //            if (TaxRate[i - 2].ToString() == "")
            //            {
            //                mTaxRate = 0;
            //            }
            //            else
            //            {
            //                mTaxRate = Convert.ToDecimal(TaxRate[i - 2].ToString());
            //            }
            //            if (TotalFee[i - 2].ToString() == "")
            //            {
            //                mTotalFee = 0;
            //            }
            //            else
            //            {
            //                mTotalFee = Convert.ToDecimal(TotalFee[i - 2].ToString());
            //            }
            //            if (TotalTax[i - 2].ToString() == "")
            //            {
            //                mTotalTax = 0;
            //            }
            //            else
            //            {
            //                mTotalTax = Convert.ToDecimal(TotalTax[i - 2].ToString());
            //            }
            //            if (UnitID[i - 2].ToString() == "")
            //            {
            //                mUnitID = 0;
            //            }
            //            else
            //            {
            //                mUnitID = Convert.ToDecimal(UnitID[i - 2].ToString());
            //            }
            //            System.Text.StringBuilder cmdsql = new System.Text.StringBuilder();
            //            //cmdsql.AppendLine(" Insert into  officedba.PurchaseContractDetail(CompanyCD,ContractNo,ProductID,ProductNo,ProductName,ProductCount,");
            //            //cmdsql.AppendLine("UnitID,RequireDate,UnitPrice,TotalPrice,ApplyReason,Remark,FromBillID,FromLineNo)");
            //            cmdsql.AppendLine(" Insert into  officedba.PurchaseContractDetail(CompanyCD,ContractNo,ProductID,ProductNo,ProductName,standard,UnitID,ProductCount,");
            //            cmdsql.AppendLine("UnitPrice,TaxPrice,Discount,TaxRate,TotalPrice,TotalFee,TotalTax,RequireDate,ApplyReason,Remark,FromBillID,FromLineNo)");
            //            cmdsql.AppendLine(" Values('" + model.CompanyCD + "','" + no + "','" + ProductID[i - 2].ToString() + "','" + ProductNo[i - 2].ToString() + "','" + ProductName[i - 2].ToString() + "','" + Standard[i - 2].ToString() + "','" + mUnitID + "','" + mProductCount + "'");
            //            cmdsql.AppendLine(",'" + mUnitPrice + "','" + mTaxPrice + "','" + mDiscount + "','" + mTaxRate + "','" + mTotalPrice + "','" + mTotalFee + "','" + mTotalTax + "'");
            //            if (RequireDate[i - 2].ToString() == "")
            //            {
            //                mRequireDate = SqlDateTime.Null;
            //                cmdsql.AppendLine("," + mRequireDate + "");
            //            }
            //            else
            //            {
            //                mRequireDate = SqlDateTime.Parse(RequireDate[i - 2].ToString());
            //                cmdsql.AppendLine(",'" + mRequireDate + "'");
            //            }
            //            cmdsql.AppendLine(",'" + ApplyReason[i - 2].ToString() + "','" + Remark[i - 2].ToString() + "','" + FromBillID[i - 2].ToString() + "','" + FromLineNo[i - 2].ToString() + "')");
            //            sql[i] = cmdsql.ToString();
            //        }
            //        return PurchaseContractDBHelper.UpdatePurchaseContract(sql);
            //    }
            //    else
            //    {
            //        sql = new string[2];
            //        sql[0] = sqlc.ToString();
            //        sql[1] = "delete from officedba.PurchaseContractDetail where CompanyCD='" + model.CompanyCD + "' and ContractNo='" + no + "' ";
            //        return PurchaseContractDBHelper.UpdatePurchaseContract(sql);
            //    }
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            #endregion
        }