public static bool ConfirmBill(StorageOutOtherModel model, out string retstrval) { //获取登陆用户信息 retstrval = ""; UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //设置公司代码 model.CompanyCD = userInfo.CompanyCD; //定义返回变量 bool isSucc = false; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //获取公司代码 string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; //执行删除操作 try { //执行更新 isSucc = StorageOutOtherDBHelper.ConfirmBill(model, out retstrval); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (isSucc) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } //操作日志 LogInfoModel logModel = InitLogInfo(model.ID); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = "确认"; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); return(isSucc); }
/// <summary> /// 插入其他出库和其他出库明细 /// </summary> /// <param name="model"></param> /// <param name="modelList"></param> /// <returns></returns> public static bool InsertStorageOutOther(StorageOutOtherModel model, Hashtable ht, List <StorageOutOtherDetailModel> modelList, out int IndexIDentity) { IndexIDentity = 0; //获取登陆用户信息 UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //设置公司代码 model.CompanyCD = userInfo.CompanyCD; //定义返回变量 bool isSucc = false; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //获取公司代码 string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; //执行删除操作 try { //执行更新 isSucc = StorageOutOtherDBHelper.InsertStorageOutOther(model, ht, modelList, out IndexIDentity); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (isSucc) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } //操作日志 LogInfoModel logModel = InitLogInfo(model.OutNo); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_INSERT; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); return(isSucc); }
//判断分仓存量表中是否有不存在的记录。 //当在无来源的时候,选择物品没有通过当前仓库选择,而是从所有的仓库中选择物品 //就会有这样的情况,当确认的时候,而物品又允许负库存的时候就会出现,在分仓存量表中 //不存在也时候也能确认。 public static string ifExist(StorageOutOtherModel model) { try { return(StorageOutOtherDBHelper.ifExist(model)); } catch (Exception) { throw; } }
protected void btnImport_Click(object sender, ImageClickEventArgs e) { StorageOutOtherModel model = new StorageOutOtherModel(); string OutDateStart = string.Empty; string OutDateEnd = string.Empty; string SendNo = string.Empty; model.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; model.OutNo = txtOutNo.Value; model.Title = txtTitle.Value; model.FromType = sltFromType.Value; model.ReasonType = ddlReason.SelectedValue; model.BillStatus = sltBillStatus.Value; model.Transactor = txtOuterID.Value; OutDateStart = txtOutDateStart.Value; OutDateEnd = txtOutDateEnd.Value; string orderBy = txtorderBy.Value; if (!string.IsNullOrEmpty(orderBy)) { if (orderBy.Split('_')[1] == "a") { orderBy = orderBy.Split('_')[0] + " asc"; } else { orderBy = orderBy.Split('_')[0] + " desc"; } } string IndexValue = GetBillExAttrControl1.GetExtIndexValue; string TxtValue = GetBillExAttrControl1.GetExtTxtValue; string BatchNo = this.txtBatchNo.Value.ToString(); string ProjectID = this.HiddenProjectID.Value.ToString(); model.ProjectID = ProjectID; DataTable dt = StorageOutOtherBus.GetStorageOutOtherTableBycondition(model, IndexValue, TxtValue, OutDateStart, OutDateEnd, BatchNo, orderBy); if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsDisplayPrice) { OutputToExecl.ExportToTableFormat(this, dt, new string[] { "出库单编号", "出库单主题", "源单类型", "出库人", "出库时间", "出库原因", "出库数量", "出库金额", "摘要", "单据状态" }, new string[] { "OutNo", "Title", "FromTypeName", "Transactor", "OutDate", "ReasonTypeName", "CountTotal", "TotalPrice", "Summary", "BillStatusName" }, "其他出库库列表"); } else { OutputToExecl.ExportToTableFormat(this, dt, new string[] { "出库单编号", "出库单主题", "源单类型", "出库人", "出库时间", "出库原因", "出库数量", "摘要", "单据状态" }, new string[] { "OutNo", "Title", "FromTypeName", "Transactor", "OutDate", "ReasonTypeName", "CountTotal", "Summary", "BillStatusName" }, "其他出库库列表"); } }
protected void LoadPrintInfo() { PrintParameterSettingModel model = new PrintParameterSettingModel(); model.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; model.BillTypeFlag = int.Parse(ConstUtil.BILL_TYPEFLAG_STORAGE); model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_OUTOTHER; StorageOutOtherModel OutOtherSellM_ = new StorageOutOtherModel(); OutOtherSellM_.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; OutOtherSellM_.ID = this.intMrpID.ToString(); /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/ string[,] aBase; string[,] aDetail; if (HiddenPrice.Value == "True") { aBase = new string[, ] { { "{ExtField1}", "ExtField1" }, { "{ExtField2}", "ExtField2" }, { "{ExtField3}", "ExtField3" }, { "{ExtField4}", "ExtField4" }, { "{ExtField5}", "ExtField5" }, { "{ExtField6}", "ExtField6" }, { "{ExtField7}", "ExtField7" }, { "{ExtField8}", "ExtField8" }, { "{ExtField9}", "ExtField9" }, { "{ExtField10}", "ExtField10" }, { "出库单编号", "OutNo" }, { "出库单主题", "Title" }, { "源单类型", "FromTypeName" }, { "源单编号", "FromBillNo" }, { "往来单位", "OtherCorpName" }, { "往来单位类型", "CorpBigTypeName" }, { "发货地址", "SendAddr" }, { "收货地址", "ReceiveAddr" }, { "经办人", "SenderName" }, { "出库部门", "DeptName" }, { "出库人", "TransactorName" }, { "出库时间", "OutDate" }, { "出库原因", "ReasonTypeName" }, { "数量合计", "CountTotal" }, { "金额合计", "A_TotalPrice" }, { "制单人", "CreatorName" }, { "制单日期", "CreateDate" }, { "确认人", "ConfirmorName" }, { "确认日期", "ConfirmDate" }, { "结单人", "CloserName" }, { "结单日期", "CloseDate" }, { "最后更新人", "ModifiedUserName" }, { "最后更新日期", "ModifiedDate" }, { "单据状态", "BillStatusName" }, { "备注", "Remark" }, { "所属项目", "ProjectName" }, { "摘要", "Summary" }, }; if (HiddenMoreUnit.Value == "True") { aDetail = new string[, ] { { "序号", "SortNo" }, { "物品编号", "ProductNo" }, { "物品名称", "ProductName" }, { "批次", "BatchNo" }, { "规格", "Specification" }, { "基本单位", "UnitID" }, { "基本数量", "ProductCount" }, { "单位", "UsedUnitName" }, { "仓库", "StorageName" }, { "退货数量", "BackCount" }, { "已出库数量", "OutedTotal" }, { "未出库数量", "NotOutCount" }, { "出库数量", "UsedUnitCount" }, { "单价", "UsedPrice" }, { "金额", "B_TotalPrice" }, { "备注", "DetaiRemark" }, }; } else { aDetail = new string[, ] { { "序号", "SortNo" }, { "物品编号", "ProductNo" }, { "物品名称", "ProductName" }, { "批次", "BatchNo" }, { "规格", "Specification" }, { "单位", "UnitID" }, { "仓库", "StorageName" }, { "退货数量", "BackCount" }, { "已出库数量", "OutedTotal" }, { "未出库数量", "NotOutCount" }, { "出库数量", "ProductCount" }, { "单价", "UnitPrice" }, { "金额", "B_TotalPrice" }, { "备注", "DetaiRemark" }, }; } } else { aBase = new string[, ] { { "{ExtField1}", "ExtField1" }, { "{ExtField2}", "ExtField2" }, { "{ExtField3}", "ExtField3" }, { "{ExtField4}", "ExtField4" }, { "{ExtField5}", "ExtField5" }, { "{ExtField6}", "ExtField6" }, { "{ExtField7}", "ExtField7" }, { "{ExtField8}", "ExtField8" }, { "{ExtField9}", "ExtField9" }, { "{ExtField10}", "ExtField10" }, { "出库单编号", "OutNo" }, { "出库单主题", "Title" }, { "源单类型", "FromTypeName" }, { "源单编号", "FromBillNo" }, { "往来单位", "OtherCorpName" }, { "往来单位类型", "CorpBigTypeName" }, { "发货地址", "SendAddr" }, { "收货地址", "ReceiveAddr" }, { "经办人", "SenderName" }, { "出库部门", "DeptName" }, { "出库人", "TransactorName" }, { "出库时间", "OutDate" }, { "出库原因", "ReasonTypeName" }, { "数量合计", "CountTotal" }, // { "金额合计", "A_TotalPrice"}, { "制单人", "CreatorName" }, { "制单日期", "CreateDate" }, { "确认人", "ConfirmorName" }, { "确认日期", "ConfirmDate" }, { "结单人", "CloserName" }, { "结单日期", "CloseDate" }, { "最后更新人", "ModifiedUserName" }, { "最后更新日期", "ModifiedDate" }, { "单据状态", "BillStatusName" }, { "备注", "Remark" }, { "所属项目", "ProjectName" }, { "摘要", "Summary" }, }; if (HiddenMoreUnit.Value == "True") { aDetail = new string[, ] { { "序号", "SortNo" }, { "物品编号", "ProductNo" }, { "物品名称", "ProductName" }, { "批次", "BatchNo" }, { "规格", "Specification" }, { "基本单位", "UnitID" }, { "基本数量", "ProductCount" }, { "单位", "UsedUnitName" }, { "仓库", "StorageName" }, { "退货数量", "BackCount" }, { "已出库数量", "OutedTotal" }, { "未出库数量", "NotOutCount" }, { "出库数量", "UsedUnitCount" }, { "单价", "UsedPrice" }, { "金额", "B_TotalPrice" }, { "备注", "DetaiRemark" }, }; } else { aDetail = new string[, ] { { "序号", "SortNo" }, { "物品编号", "ProductNo" }, { "物品名称", "ProductName" }, { "批次", "BatchNo" }, { "规格", "Specification" }, { "单位", "UnitID" }, { "仓库", "StorageName" }, { "退货数量", "BackCount" }, { "已出库数量", "OutedTotal" }, { "未出库数量", "NotOutCount" }, { "出库数量", "ProductCount" }, { "单价", "UnitPrice" }, { "金额", "B_TotalPrice" }, { "备注", "DetaiRemark" }, }; } } #region 1.扩展属性 int countExt = 0; DataTable dtExtTable = XBase.Business.Office.SupplyChain.TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.StorageOutOther"); if (dtExtTable.Rows.Count > 0) { for (int i = 0; i < dtExtTable.Rows.Count; i++) { for (int x = 0; x < (aBase.Length / 2) - 15; x++) { if (x == i) { aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString(); countExt++; } } } } #endregion DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model); DataTable dtMain = StorageOutOtherBus.GetStorageOutOtherDetailInfo(OutOtherSellM_); // DataTable dtDetail = MRPBus.GetMRPDetailInfo(modelMRP); string strBaseFields = ""; string strDetailFields = ""; if (dbPrint.Rows.Count > 0) { isSeted.Value = "1"; strBaseFields = dbPrint.Rows[0]["BaseFields"].ToString(); strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString(); } else { #region 未设置过打印模板设置 默认显示所有的 isSeted.Value = "0"; /*未设置过打印模板设置时,默认显示的字段 基本信息字段*/ for (int m = 10; m < aBase.Length / 2; m++) { strBaseFields = strBaseFields + aBase[m, 1] + "|"; } /*未设置过打印模板设置时,默认显示的字段 基本信息字段+扩展信息字段*/ if (countExt > 0) { for (int i = 0; i < countExt; i++) { strBaseFields = strBaseFields + "ExtField" + (i + 1) + "|"; } } /*未设置过打印模板设置时,默认显示的字段 明细信息字段*/ for (int n = 0; n < aDetail.Length / 2; n++) { strDetailFields = strDetailFields + aDetail[n, 1] + "|"; } #endregion } #region 主表信息 if (!string.IsNullOrEmpty(strBaseFields)) { tableBase.InnerHtml = WritePrintPageTable("其他出库单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMain, dtMain, true); } #endregion #region 明细信息 if (!string.IsNullOrEmpty(strDetailFields)) { tableDetail.InnerHtml = WritePrintPageTable("销售出库单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMain, dtMain, false); } #endregion }
public static string ISBigUseCountWhenCant(StorageOutOtherModel model) { return(StorageOutOtherDBHelper.ISBigUseCountWhenCant(model)); }
/// <summary> /// /// </summary> /// <param name="model">CompanyCD,ID</param> /// <returns></returns> public static bool ISConfirmBill(StorageOutOtherModel model) { return(StorageOutOtherDBHelper.ISConfirmBill(model)); }
/// <summary> /// 获取其他出库详细信息(加载页面的时候) /// </summary> /// <returns>DataTable</returns> public static DataTable GetStorageOutOtherDetailInfo(StorageOutOtherModel model) { return(StorageOutOtherDBHelper.GetStorageOutOtherDetailInfo(model)); }
public static DataTable GetStorageOutOtherTableBycondition(StorageOutOtherModel model, string IndexValue, string TxtValue, string timeStart, string timeEnd, string BatchNo, string orderby) { return(StorageOutOtherDBHelper.GetStorageOutOtherTableBycondition(model, IndexValue, TxtValue, timeStart, timeEnd, BatchNo, orderby)); }
/// <summary> /// 查询其他出库单 /// </summary> /// <returns>DataTable</returns> public static DataTable GetStorageOutOtherTableBycondition(StorageOutOtherModel model, string timeStart, string timeEnd, string EFIndex, string EFDesc, int pageIndex, int pageCount, string ord, ref int TotalCount) { return(StorageOutOtherDBHelper.GetStorageOutOtherTableBycondition(model, timeStart, timeEnd, EFIndex, EFDesc, pageIndex, pageCount, ord, ref TotalCount)); }