public static bool CancelConfirm(StorageBorrow borrow) { //定义返回变量 bool res = false; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //获取当前用户信息 UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //执行操作 try { //执行操作 res = XBase.Data.Office.StorageManager.StorageBorrowDBHelper.CancelConfirm(borrow); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (res) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } //操作日志 LogInfoModel logModel = InitLogInfo(borrow.BorrowNo); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_UNCONFIRM; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); return(res); }
public static string SetStorageBorrow(StorageBorrow sborrow, List <StorageBorrowDetail> detailsList, Hashtable ht) { //定义返回变量 string Result = string.Empty; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //获取当前用户信息 UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //执行操作 try { //执行操作 Result = XBase.Data.Office.StorageManager.StorageBorrowDBHelper.SetBorrowStorage(sborrow, detailsList, ht); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (Result.Split('|')[0] == "1") { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } //操作日志 LogInfoModel logModel = InitLogInfo(sborrow.BorrowNo); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_INSERT; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); return(Result); }
protected void imgOutput_Click(object sender, ImageClickEventArgs e) { StorageBorrow borrow = new StorageBorrow(); borrow.BorrowNo = string.IsNullOrEmpty(tboxBorrowNo.Value.Trim())?string.Empty:("%" + tboxBorrowNo.Value.Trim() + "%"); borrow.Title = string.IsNullOrEmpty(tboxTitle.Value.Trim()) ? string.Empty : ("%" + tboxTitle.Value.Trim() + "%"); borrow.Borrower = Convert.ToInt32(string.IsNullOrEmpty(txtBorrower.Value.Trim())?"-1":txtBorrower.Value.Trim()); borrow.DeptID = Convert.ToInt32(string.IsNullOrEmpty(txtBorrowDeptID.Value.Trim())?"-1":txtBorrowDeptID.Value.Trim()); borrow.OutDeptID = Convert.ToInt32(string.IsNullOrEmpty(txtOutDept.Value.Trim())?"-1":txtOutDept.Value.Trim()); borrow.StorageID = Convert.ToInt32(string.IsNullOrEmpty(ddlDepot.SelectedItem.Value)?"-1":ddlDepot.SelectedItem.Value); borrow.Transactor = Convert.ToInt32(string.IsNullOrEmpty(txtTransactor.Value.Trim())?"-1":txtTransactor.Value.Trim()); borrow.BillStatus = string.IsNullOrEmpty(ddlBillStatus.SelectedItem.Value)?string.Empty:ddlBillStatus.SelectedItem.Value; borrow.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; DateTime start = Convert.ToDateTime(string.IsNullOrEmpty(tboxBorrowStartTime.Text.Trim()) ? DateTime.MinValue.ToString() : tboxBorrowStartTime.Text.Trim()); DateTime end = Convert.ToDateTime(string.IsNullOrEmpty(tboxBorrowEndTime.Text.Trim()) ? DateTime.MinValue.ToString() : tboxBorrowEndTime.Text.Trim()); int SubmitStatus = Convert.ToInt32(string.IsNullOrEmpty(ddlSubmitStatus.SelectedItem.Value)?"-1":ddlSubmitStatus.SelectedItem.Value); string orderString = (string.IsNullOrEmpty(txtOrderBy.Value.Trim()) ? string.Empty : txtOrderBy.Value.Trim()); //排序 string order = "DESC"; //排序:升序 string orderBy = (!string.IsNullOrEmpty(orderString)) ? orderString.Substring(0, orderString.Length - 2) : "ID"; //要排序的字段,如果为空,默认为"ID" if (orderString.EndsWith("_a")) { order = "ASC";//排序:降序 } //扩展属性 string EFIndex = Request.QueryString["EFIndex"]; string EFDesc = Request.QueryString["EFDesc"]; GetBillExAttrControl1.ExtIndex = EFIndex; GetBillExAttrControl1.ExtValue = EFDesc; GetBillExAttrControl1.SetExtControlValue(); orderBy = orderBy + " " + order; DataTable dt = XBase.Business.Office.StorageManager.StorageBorrowBus.GetStorageList(EFIndex, EFDesc, borrow, orderBy, start, end, SubmitStatus); foreach (DataRow row in dt.Rows) { if (row["FlowStatus"] == null || row["FlowStatus"].ToString() == "") { row["FlowStatus"] = ""; } else if (row["FlowStatus"].ToString() == "1") { row["FlowStatus"] = "待审批"; } else if (row["FlowStatus"].ToString() == "2") { row["FlowStatus"] = "审批中"; } else if (row["FlowStatus"].ToString() == "3") { row["FlowStatus"] = "审批通过"; } else if (row["FlowStatus"].ToString() == "4") { row["FlowStatus"] = "审批不通过"; } else if (row["FlowStatus"].ToString() == "5") { row["FlowStatus"] = "撤销审批"; } } OutputToExecl.ExportToTableFormat(this, dt, new string[] { "借货单编号", "借货单主题", "借货部门", "借货人", "被借部门", "被借仓库", "借货数量", "借货金额", "出库人", "出库时间", "单据状态", "审批状态" }, new string[] { "BorrowNo", "Title", "DeptID", "Borrower", "OutDeptID", "StorageID", "CountTotal", "TotalPrice", "Transactor", "OutDate", "BillStatus", "FlowStatus" }, "借货单列表"); }
/*不分页*/ public static DataTable GetStorageList(string EFIndex, string EFDesc, StorageBorrow borrow, string OrderBy, DateTime StartTime, DateTime EndTime, int SubmitStatus) { return(XBase.Data.Office.StorageManager.StorageBorrowDBHelper.GetStorageList(EFIndex, EFDesc, borrow, OrderBy, StartTime, EndTime, SubmitStatus)); }
public static DataTable GetStorageList(string EFIndex, string EFDesc, int PageIndex, int PageSzie, string OrderBy, ref int TotalCount, StorageBorrow borrow, DateTime StartTime, DateTime EndTime, int SubmitStatus) { return(XBase.Data.Office.StorageManager.StorageBorrowDBHelper.GetStorageList(EFIndex, EFDesc, PageIndex, PageSzie, OrderBy, ref TotalCount, borrow, StartTime, EndTime, SubmitStatus)); }