/// <summary> /// 根据检索条件检索收款单信息 /// </summary> /// <param name="IncomeBillNo">收款单号</param> /// <param name="AcceWay">收款方式</param> /// <param name="TotalPrice">收款金额</param> /// <param name="ConfirmStatus">确认状态</param> /// <param name="IsVoucher">是否登记凭证</param> /// <param name="StartDate">开始日期</param> /// <param name="EndDate">结束日期</param> /// <returns>DataTable</returns> public static DataTable SearchIncomeInfo(string ProjectID, string IncomeBillNo, string AcceWay, string TotalPrice , string ConfirmStatus, string IsVoucher, string StartDate, string EndDate, int pageIndex, int pageSize, string OrderBy, ref int totalCount) { string CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; try { return(IncomeBillDBHelper.SearchIncomeInfo(ProjectID, CompanyCD, IncomeBillNo, AcceWay, TotalPrice, ConfirmStatus, IsVoucher, StartDate, EndDate, pageIndex, pageSize, OrderBy, ref totalCount)); } catch (Exception ex) { throw ex; } }
/// <summary> /// 反确认收款单 /// </summary> /// <param name="ID">主键ID</param> /// <param name="Confirmor">确认人</param> /// <returns>true成功,false失败</returns> public static bool ReConfirmIncomeBill(string ID) { UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; bool isSucc = false; try { isSucc = IncomeBillDBHelper.ReConfirmIncomeBill(ID); //定义变量 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_ANTIAUDIT; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); } return(isSucc); } catch (Exception ex) { WriteSystemLog(userInfo, 1, ex); return(false); } }
/// <summary> /// 修改收款单信息 /// </summary> /// <param name="model">收款单实体</param> /// <returns>true 成功,false失败</returns> public static bool UpdateIncomeBill(IncomeBillModel model, decimal OldPrice) { if (model == null) { return(false); } model.ModifiedUserID = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID; UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; try { bool succ = false; string loginUserID = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID; LogInfoModel logModel = InitLogInfo(model.InComeNo, 0); logModel.Element = ConstUtil.LOG_PROCESS_UPDATE; succ = IncomeBillDBHelper.UpdateIncomeBill(model, OldPrice); if (!succ) { logModel.Remark = ConstUtil.LOG_PROCESS_FAILED; } else { logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS; } LogDBHelper.InsertLog(logModel); return(succ); } catch (Exception ex) { WriteSystemLog(userInfo, 0, ex); return(false); } }
/// <summary> /// 添加收款单信息 /// </summary> /// <param name="model">收款单实体</param> /// <returns>true 成功,false失败</returns> public static bool InsertIncomeBill(IncomeBillModel model, out int ID) { ID = 0; UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; model.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; model.ModifiedUserID = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID; try { bool succ = false; string loginUserID = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID; LogInfoModel logModel = InitLogInfo(model.InComeNo, 0); logModel.Element = ConstUtil.LOG_PROCESS_UPDATE; succ = IncomeBillDBHelper.InsertIncomeBill(model, out ID); if (!succ) { logModel.Remark = ConstUtil.LOG_PROCESS_FAILED; } else { logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS; } LogDBHelper.InsertLog(logModel); return(succ); } catch (Exception ex) { WriteSystemLog(userInfo, 0, ex); return(false); } }
/// <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); } }