private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); if (!string.IsNullOrEmpty(_goods)) { ddlGoods.SelectedValue = _goods; } if (!string.IsNullOrEmpty(_customer1)) { ddlCustomer1.SelectedValue = _customer1; } if (!string.IsNullOrEmpty(_customer2)) { ddlCustomer2.SelectedValue = _customer2; } if (!string.IsNullOrEmpty(_beginTime)) { txtBeginTime.Text = _beginTime; } if (!string.IsNullOrEmpty(_endTime)) { txtEndTime.Text = _endTime; } this.txtKeywords.Text = this.keywords; BLL.Order bll = new BLL.Order(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("order_list.aspx", "goods={0}&customer1={1}&customer2={2}&beginTime={3}&endTime={4}&keywords={5}&page={6}", _goods, _customer1, _customer2, _beginTime, _endTime, this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void deleteOrderFile(HttpContext context) { //检查是否允许匿名上传 if (!new ManagePage().IsAdminLogin()) { context.Response.Write("{\"status\": 0, \"msg\": \"禁止匿名非法删除!\"}"); return; } BLL.Order bll = new BLL.Order(); Model.manager manager = new ManagePage().GetAdminInfo();//获得当前登录管理员信息 int id = DTRequest.GetQueryInt("id"); Model.Files file = bll.GetFileModel(id); Model.Order order = bll.GetModel(file.f_oid); if (order.o_lockStatus == 1) { context.Response.Write("{\"status\": 0, \"msg\": \"订单已锁定,不能再删除!\"}"); context.Response.End(); } if (bll.deleteOrderFile(file, manager)) { context.Response.Write("{\"status\": 1, \"msg\": \"删除成功!\"}"); context.Response.End(); } context.Response.Write("{\"status\": 0, \"msg\": \"删除失败!\"}"); context.Response.End(); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("sys_order_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.Order bll = new BLL.Order(); string result = ""; int success = 0, error = 0; StringBuilder sb = new StringBuilder(); manager = GetAdminInfo(); for (int i = 0; i < rptList.Items.Count; i++) { CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { result = bll.DeleteOrder(((HiddenField)rptList.Items[i].FindControl("hidId")).Value, manager); if (result == "") { success++; } else { error++; sb.Append(result + "<br/>"); } } } JscriptMsg("共选择" + (success + error) + "条记录,成功" + success + "条,失败" + error + "条<br/>" + sb.ToString(), backUrl()); }
private void Bind() { if (string.IsNullOrEmpty(orderNum)) { WebHelper.MessageBox.Messager(this.Page, Page.Controls[0], "非法进入,已终止执行", "操作错误", "error"); return; } if (bll == null) { bll = new BLL.Order(); } Model.OrderInfo model = bll.GetModel(orderNum, userId); if (model == null) { WebHelper.MessageBox.Messager(this.Page, Page.Controls[0], "非法操作,已终止执行", "操作错误", "error"); return; } string htmlAppend = "<s class=\"icon-succ02\"></s><h3 class=\"ftx-02\">付款成功,我们将尽快处理,请耐心等待!</h3>"; htmlAppend += "<ul class=\"list-h\"><li class=\"fore1\">订单号:" + model.OrderNum + "</li>"; htmlAppend += "<li class=\"fore2\">已付金额:<strong class=\"ftx-01\">" + model.TotalPrice + "元</strong></li>"; htmlAppend += "</ul></div>"; ltrSucceed.Text = htmlAppend; }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("order_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.Order bll = new BLL.Order(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除订单" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("dialog_order_list.aspx", "goods={0}&customer1={1}&customer2={2}&keywords={3}&transportOrderId=" + this.transportOrderId + "", _goods.ToString(), _customer1.ToString(), _customer2.ToString(), this.keywords), "Success"); }
public static bool CheckOrderAttach(int OrderID, string configName) { BLL.Order order = new BLL.Order(); Common.Entity.Order oInfo = order.GetOrderByPKID(OrderID); IList <string> orderCars = order.GetCarsOrder(OrderID); JArray requireJObj = JArray.Parse(ConfigurationManager.AppSettings[configName]); IList <string> filesRequire = _getMatchingAttach(oInfo, orderCars, requireJObj); String uploadTempPath = ConfigurationManager.AppSettings["uploadPath"]; string tempPath = oInfo.Code.Split(new char[] { '-' })[1]; uploadTempPath = uploadTempPath + "\\OrdersPic\\" + tempPath.Substring(0, 4) + "\\" + tempPath + "\\"; foreach (string s in filesRequire) { if ("9" == s) { //9,B,C,D,E都为合同 if (!(File.Exists(string.Format("{0}{1}fufAttach9.jpg", uploadTempPath, oInfo.Code)) || File.Exists(string.Format("{0}{1}fufAttachB.jpg", uploadTempPath, oInfo.Code)) || File.Exists(string.Format("{0}{1}fufAttachC.jpg", uploadTempPath, oInfo.Code)) || File.Exists(string.Format("{0}{1}fufAttachD.jpg", uploadTempPath, oInfo.Code)) || File.Exists(string.Format("{0}{1}fufAttachE.jpg", uploadTempPath, oInfo.Code)))) { return(false); } } else { if (!File.Exists(string.Format("{0}{1}fufAttach{2}.jpg", uploadTempPath, oInfo.Code, s))) { return(false); } } } return(true); }
private void Bind() { if (!string.IsNullOrEmpty(orderNum)) { if (bll == null) { bll = new BLL.Order(); } Model.OrderInfo model = bll.GetModel(orderNum, userId); if (model == null) { ltrBank.Text = ""; WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "非法操作,已终止执行", "操作错误", "error"); return; } ViewState["OrderId"] = model.OrderId; ViewState["TotalPrice"] = model.TotalPrice; string htmlAppend = "<s class=\"icon-succ02\"></s><h3 class=\"ftx-02\">订单提交成功,请您尽快付款!</h3>"; htmlAppend += "<ul class=\"list-h\"><li class=\"fore1\">订单号:" + model.OrderNum + "</li>"; htmlAppend += "<li class=\"fore2\">应付金额:<strong class=\"ftx-01\">" + model.TotalPrice + "元</strong></li>"; htmlAppend += "</ul><p id=\"p_show_info\"> </p><p class=\"reminder\"><strong>立即支付<span class=\"ftx-01\">" + model.TotalPrice + "元</span>,即可完成订单。</strong>"; htmlAppend += "请您在<span class=\"ftx-04\">24小时</span>内完成支付,否则订单会被自动取消。</p></div>"; ltrSucceed.Text = htmlAppend; } }
/// <summary> /// /// </summary> /// <param name="ordID"></param> /// <param name="returnToApproval">When false, the order is cancelled completely</param> /// <returns></returns> public static bool ReleaseReservation(int ordID, bool returnToApproval) { BLL.Order ord = new BLL.Order(); ord.LoadByPrimaryKey(ordID); MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { transaction.BeginTransaction(); if (ord.RowCount > 0 && (ord.OrderStatusID == OrderStatus.Constant.PICK_LIST_GENERATED || ord.OrderStatusID == OrderStatus.Constant.PICK_LIST_CONFIRMED)) { ord.ReleaseReservation(); if (returnToApproval) { ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED, CurrentContext.UserId); } else { ord.ChangeStatus(OrderStatus.Constant.CANCELED, CurrentContext.UserId); } ord.Save(); } transaction.CommitTransaction(); return(true); } catch (Exception exp) { transaction.RollbackTransaction(); throw (exp); } }
public ActionResult List() { StringBuilder sb = new StringBuilder(); int page = int.Parse(Request.QueryString["page"].ToString()); int limit = int.Parse(Request.QueryString["limit"].ToString()); String select = "SELECT ROW_NUMBER() OVER (order by a.Id desc)AS Row,a.*,c.CompanyName,b.Id as pid,b.ProductName,b.ProductClass,b.Unit,b.Price,b.Cost,b.Spec,b.ProductCount,b.OrderId "; String sql = " from [Order] a left join Company c on a.CompanyId=c.Id left join OrderProduct b on a.Id=b.OrderId "; string where = " where 1=1"; if (!String.IsNullOrEmpty(Request.QueryString["orderCode"])) { where += " and orderCode like '%" + Request.QueryString["orderCode"] + "%'"; } if (!String.IsNullOrEmpty(Request.QueryString["status"])) { where += " and status = " + Request.QueryString["status"]; } DataTable dt = new BLL.Order().GetListByPage2(select + sql + where, "id", (page - 1) * limit, page * limit).Tables[0]; sb.Append("{\"status\": 200,\"message\": \"\",\"total\": " + new BLL.Order().GetRecordCount(where) + ",\"rows\": {\"item\": ["); for (int i = 0; i < dt.Rows.Count; i++) { if (i > 0) { sb.Append(","); } sb.Append("{\"id\":" + dt.Rows[i]["Id"] + ",\"orderCode\":\"" + dt.Rows[i]["OrderCode"] + "\",\"productName\":\"" + dt.Rows[i]["ProductName"] + "\",\"productCount\":\"" + dt.Rows[i]["ProductCount"] + "\",\"price\":" + dt.Rows[i]["Price"]); sb.Append(",\"productClass\":\"" + dt.Rows[i]["ProductClass"] + "\""); sb.Append(",\"companyName\":\"" + dt.Rows[i]["CompanyName"] + "\""); sb.Append(",\"contacter\":\"" + dt.Rows[i]["Contacter"] + "\""); sb.Append(",\"contactMobile\":" + dt.Rows[i]["ContactMobile"]); sb.Append(",\"address\":\"" + dt.Rows[i]["Address"] + "\""); sb.Append(",\"amount\":" + dt.Rows[i]["Amount"]); sb.Append(",\"cost\":" + dt.Rows[i]["Cost"]); sb.Append(",\"createDate\":\"" + dt.Rows[i]["CreateDate"] + "\""); if (dt.Rows[i]["Status"].ToString() == "0") { sb.Append(",\"status\":\"未支付\""); } else if (dt.Rows[i]["Status"].ToString() == "1") { sb.Append(",\"status\":\"已支付\""); } else if (dt.Rows[i]["Status"].ToString() == "9") { sb.Append(",\"status\":\"已退货\""); } else if (dt.Rows[i]["Status"].ToString() == "-1") { sb.Append(",\"status\":\"已删除\""); } sb.Append("}"); } sb.Append("]}}"); return(Content(sb.ToString())); }
private void OnPay() { if (ViewState["OrderId"] == null || ViewState["TotalPrice"] == null) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "当前订单不存在,请检查", "系统提示"); return; } object orderId = ViewState["OrderId"]; decimal totalPrice = 0; if (!decimal.TryParse(ViewState["TotalPrice"].ToString(), out totalPrice)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "付款金额转换失败,请检查", "系统提示"); return; } if (bll == null) { bll = new BLL.Order(); } if (bll.PayPrice(Guid.Parse(userId), orderId, totalPrice) > 0) { Response.Redirect(string.Format("PayOrder.aspx?oN={0}", HttpUtility.UrlEncode(orderNum)), true); } else { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "付款失败,请检查", "系统提示"); } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("order_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.Order bll = new BLL.Order(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除订单" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("order_list.aspx", "goods={0}&customer1={1}&customer2={2}&keywords={3}", _goods, _customer1, _customer2, this.keywords), "Success"); }
private void xrInsuranceValue_SummaryCalculated(object sender, DevExpress.XtraReports.UI.TextFormatEventArgs e) { try { NumberToEnglish converter = new NumberToEnglish(); totalWithoutInsurance = Convert.ToDouble(e.Value); if (_includeInsurance) { BLL.Order order = new BLL.Order(); insuranceValue = BLL.Order.GetInsuranceValue(_orderID, totalWithoutInsurance); e.Text = insuranceValue.ToString("###,###,##0.#0"); xrTotalPrice.Text = (insuranceValue + totalWithoutInsurance).ToString(); } else { insuranceValue = 0; e.Text = " - "; xrTotalPrice.Text = totalWithoutInsurance.ToString(); } } catch { } }
private void ShowInfo(int _id) { BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); txtAcceptOrderTime.Text = model.AcceptOrderTime.ToString("yyyy-MM-dd"); txtArrivedTime.Text = model.ArrivedTime.ToString("yyyy-MM-dd"); txtQuantity.Text = model.Quantity.ToString(); chkIsCharteredCar.Checked = model.IsCharteredCar == 1; if (!string.IsNullOrEmpty(model.Haulway)) { ddlHaulway.Items.FindByText(model.Haulway).Selected = true; } txtLoadingCapacityRunning.Text = model.LoadingCapacityRunning.ToString(); txtNoLoadingCapacityRunning.Text = model.NoLoadingCapacityRunning.ToString(); if (!string.IsNullOrEmpty(model.Formula)) { ddlFormula.Items.FindByText(model.Formula).Selected = true; } txtUnitPrice.Text = model.UnitPrice.ToString(); txtTotalPrice.Text = model.TotalPrice.ToString(); if (!string.IsNullOrEmpty(model.Shipper)) { ddlShipper.Items.FindByText(model.Shipper).Selected = true; } txtShipperLinkMan.Text = model.ShipperLinkMan; txtShipperLinkTel.Text = model.ShipperLinkTel; if (!string.IsNullOrEmpty(model.Receiver)) { ddlReceiver.Items.FindByText(model.Receiver).Selected = true; } txtReceiverLinkMan.Text = model.ReceiverLinkMan; txtReceiverLinkTel.Text = model.ReceiverLinkTel; txtContractNumber.Text = model.ContractNumber; txtBillNumber.Text = model.BillNumber; txtWeighbridgeNumber.Text = model.WeighbridgeNumber; if (!string.IsNullOrEmpty(model.LoadingAddress)) { ddlLoadingAddress.Items.FindByText(model.LoadingAddress).Selected = true; } if (!string.IsNullOrEmpty(model.UnloadingAddress)) { ddlUnloadingAddress.Items.FindByText(model.UnloadingAddress).Selected = true; } if (!string.IsNullOrEmpty(model.SettleAccountsWay)) { ddlSettleAccountsWay.Items.FindByText(model.SettleAccountsWay).Selected = true; } if (!string.IsNullOrEmpty(model.Goods)) { ddlGoods.Items.FindByText(model.Goods).Selected = true; } txtUnit.Text = model.Unit; txtRemarks.Text = model.Remarks; }
/// <summary> /// 开票 /// </summary> /// <param name="id"></param> /// <param name="status"></param> /// <param name="username"></param> /// <param name="realname"></param> /// <returns></returns> public string confirmInvoice(int id, bool?status, string date, Model.manager adminModel) { if (status.Value && string.IsNullOrEmpty(date)) { return("请填写开票日期"); } Model.invoices model = GetModel(id); if (model == null) { return("数据不存在"); } if (model.inv_isConfirm == status) { return("状态未变更"); } if (model.inv_flag3 != 2) { return("财务审批未通过,不能开票"); } if (!new permission().checkHasPermission(adminModel, "0408")) { return("无权限开票"); } string _content = "发票id:" + id + ",开票状态:" + Common.BusinessDict.invoiceConfirmStatus()[model.inv_isConfirm] + "→<font color='red'>" + Common.BusinessDict.invoiceConfirmStatus()[status] + "</font>,开票日期:" + date; if (dal.confirmInvoice(id, status, ConvertHelper.toDate(date), adminModel.user_name, adminModel.real_name)) { //写日志 Model.business_log log = new Model.business_log(); log.ol_title = "发票开票"; log.ol_oid = model.inv_oid; log.ol_cid = model.inv_cid.Value; log.ol_relateID = id; log.ol_content = _content; new business_log().Add(DTEnums.ActionEnum.Audit.ToString(), log, adminModel.user_name, adminModel.real_name); //信息通知下申请通知人、业务员 if (status.Value) { string replaceContent = new BLL.Customer().GetModel(model.inv_cid.Value).c_name + "," + model.inv_money; string replaceUser = adminModel.user_name + "," + adminModel.real_name; new BLL.selfMessage().AddMessage("开票申请财务已开具", model.inv_personNum, model.inv_personName, replaceContent, replaceUser); //通知业务员 DataSet ds = new BLL.Order().GetPersonList(0, "op_oid='" + model.inv_oid + "' and op_type=1", ""); if (ds != null && ds.Tables[0].Rows.Count > 0) { new BLL.selfMessage().AddMessage("开票申请财务已开具", ds.Tables[0].Rows[0]["op_number"].ToString(), ds.Tables[0].Rows[0]["op_name"].ToString(), replaceContent, replaceUser); } } return(""); } return("操作失败"); }
private void Bind() { if (bll == null) { bll = new BLL.Order(); } int totalCount = 0; rpData.DataSource = bll.GetDsForOrderInfo(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out totalCount, sqlWhere, parms == null ? null : parms.ToArray()); rpData.DataBind(); AspNetPager1.RecordCount = totalCount; }
/// <summary> /// 删除一条数据 /// </summary> public string Delete(int id, Model.manager manager) { Model.invoices model = GetModel(id); if (model == null) { return("数据不存在"); } if (model.inv_flag3 == 2) { return("最终审批通过不能再编辑"); } Model.Order order = new BLL.Order().GetModel(model.inv_oid); if (order == null) { return("订单不存在"); } if (!new BLL.permission().checkHasPermission(manager, "0401"))//如果不是财务 { //验证权限:在同一个订单里,业务员与业务报账员可以对未审核地接进行编辑与删除!执行人员只能对自己地址进行编辑与删除操作! if (model.inv_personNum != manager.user_name && order.personlist.Where(p => p.op_number == manager.user_name && (p.op_type == 3 || p.op_type == 4)).ToArray().Length > 0) { return("无权限删除"); } } else { if (model.inv_personNum != manager.user_name && !new BLL.permission().checkHasPermission(manager, "0403")) { return("非申请人或没有删除他人数据权限不能删除"); } } if (dal.Delete(id)) { StringBuilder content = new StringBuilder(); content.Append("购买方名称:" + model.inv_purchaserName + "<br/>"); content.Append("购买方账号:" + model.inv_purchaserBankNum + "<br/>"); content.Append("金额:" + model.inv_money + "<br/>"); content.Append("应税劳务、服务名称:" + model.inv_serviceType + "," + model.inv_serviceName + "<br/>"); content.Append("送票方式:" + model.inv_sentWay + "<br/>"); content.Append("开票区域:" + model.inv_darea + "<br/>"); Model.business_log logmodel = new Model.business_log(); logmodel.ol_relateID = model.inv_id.Value; logmodel.ol_oid = model.inv_oid; logmodel.ol_cid = model.inv_cid.Value; logmodel.ol_title = "删除发票"; logmodel.ol_content = content.ToString(); logmodel.ol_operateDate = DateTime.Now; new business_log().Add(DTEnums.ActionEnum.Delete.ToString(), logmodel, manager.user_name, manager.real_name); //记录日志 return(""); } return("删除失败"); }
//protected string minDate = "", maxDate = ""; protected void Page_Load(object sender, EventArgs e) { oID = DTRequest.GetString("oID"); cid = DTRequest.GetString("cid"); cusName = DTRequest.GetString("cusname"); Model.Order order = new BLL.Order().GetModel(oID); if (order == null) { JscriptMsg("订单不存在!", "back"); return; } //minDate = order.o_sdate.Value.ToString("yyyy-MM-dd"); //maxDate = order.o_edate.Value.ToString("yyyy-MM-dd"); }
/// <summary> /// 审批应收应付 /// </summary> /// <param name="id"></param> /// <param name="status"></param> /// <param name="remark"></param> /// <param name="manager"></param> /// <returns></returns> public string checkStatus(int id, byte?status, string remark, Model.manager manager) { Model.finance model = GetModel(id); if (model == null) { return("数据不存在"); } if (!string.IsNullOrEmpty(model.fin_month)) { return("已结账,不能审批"); } if (model.fin_flag == status) { return("状态未变更"); } if (manager.area != new BLL.department().getGroupArea() || !new BLL.permission().checkHasPermission(manager, "0405")) { return("无权限审批"); } Model.Order order = new BLL.Order().GetModel(model.fin_oid); if (order != null && order.o_lockStatus == 1) { return("订单已锁单,不能再审批"); } string content = "记录id:" + id + ",审批状态:" + Common.BusinessDict.checkStatus()[model.fin_flag] + "→<font color='red'>" + Common.BusinessDict.checkStatus()[status] + "</font><br/>审批人:" + model.fin_checkNum + "(" + model.fin_checkName + ")→<font color='red'>" + manager.user_name + "(" + manager.real_name + ")</font><br/>审批备注:" + model.fin_checkRemark + "→<font color='red'>" + remark + "</font><br/>"; model.fin_flag = status; model.fin_checkNum = manager.user_name; model.fin_checkName = manager.real_name; model.fin_checkRemark = remark; if (model.fin_flag == 0) { model.fin_checkNum = ""; model.fin_checkName = ""; model.fin_checkRemark = ""; } if (dal.Update(model)) { //写日志 Model.business_log log = new Model.business_log(); log.ol_title = "审批应收付记录"; log.ol_oid = model.fin_oid; log.ol_cid = model.fin_cid.Value; log.ol_content = content; new business_log().Add(DTEnums.ActionEnum.Audit.ToString(), log, manager.user_name, manager.real_name); return(""); } return("审批失败"); }
private void RptBind(string _strWhere, string _orderby) { if (!this.isSearch) { this.page = DTRequest.GetQueryInt("page", 1); } else { this.page = 1; } BLL.Order bll = new BLL.Order(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount, false, "", true, orderType, currentUser); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = backUrl(); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); txtOrderID.Text = _orderid; txtCusName.Text = _cusName; hCusId.Value = _cid; ddlContractPrice.SelectedValue = _contractPrice; ddlstatus.SelectedValue = _status; ddldstatus.SelectedValue = _dstatus; ddlispush.SelectedValue = _pushstatus; ddlflag.SelectedValue = _flag; ddllock.SelectedValue = _lockstatus; txtContent.Text = _content; txtAddress.Text = _address; ddlmoneyType.SelectedValue = _moneyType; ddlsign.SelectedValue = _sign; txtMoney.Text = _money; txtPerson1.Text = _person1; txtPerson2.Text = _person2; txtPerson3.Text = _person3; txtPerson4.Text = _person4; txtPerson5.Text = _person5; txtsDate.Text = _sdate; txteDate.Text = _edate; txtsDate1.Text = _sdate1; txteDate1.Text = _edate1; ddlarea.SelectedValue = _area; txtsDate2.Text = _sdate2; txteDate2.Text = _edate2; }
private void change_OrderStatus(HttpContext context) { int tag = DTRequest.GetFormInt("tag", 0); string oID = DTRequest.GetFormString("oID"); int status = DTRequest.GetFormInt("status", 0); int flag = DTRequest.GetFormInt("flag", 0); byte? lockstatus = Utils.ObjToByte(DTRequest.GetFormString("lockstatus")); decimal cost = DTRequest.GetFormDecimal("cost", 0); string finRemark = DTRequest.GetFormString("finRemark"); if (tag == 0) { context.Response.Write("{ \"msg\":\"参数错误\", \"status\":\"1\" }"); return; } BLL.Order bll = new BLL.Order(); Model.manager manager = new ManagePage().GetAdminInfo(); string result = string.Empty; if (tag == 1) { result = bll.updateDstatus(oID, (byte)status, manager); } else if (tag == 2) { result = bll.updateFlag(oID, (byte)flag, manager); } else if (tag == 3) { result = bll.updateLockStatus(oID, lockstatus, manager); } else if (tag == 4) { result = bll.updateCost(oID, cost, manager); } else { result = bll.updateFinRemark(oID, finRemark, manager); } if (string.IsNullOrEmpty(result)) { context.Response.Write("{ \"msg\":\"" + oID + "\", \"status\":\"0\" }"); return; } context.Response.Write("{ \"msg\":\"" + result + "\", \"status\":\"1\" }"); return; }
protected void Page_Load(object sender, EventArgs e) { oID = DTRequest.GetString("oID"); Model.Order order = new BLL.Order().GetModel(oID); if (order == null) { JscriptMsg("订单不存在!", "back"); return; } if (order.o_lockStatus == 1) { PrintJscriptMsg("订单已锁定,不能再添加合作分成", ""); return; } sdate = order.o_sdate.Value.ToString("yyyy-MM-dd"); edate = order.o_edate.Value.ToString("yyyy-MM-dd"); OrderPerson op = order.personlist.Where(p => p.op_type == 1).ToArray()[0]; string place = ("," + order.o_place + ",").Replace("," + op.op_area + ",", ","); string area = ""; if (!string.IsNullOrEmpty(place)) { string[] plist = place.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); foreach (string item in plist) { area = new BLL.department().getAreaText(item); trHtml += "<tr style=\"text-align: center;\" class=\"computeTR\">"; trHtml += "<td>" + area + "</td>"; trHtml += "<td>业绩分成(" + area + ")</td>"; trHtml += "<td><input type=\"text\" name=\"txtExpression1\" data-area=\"" + item + "\" style=\"width: 200px; \" class=\"input\" onblur=\"computeResult(this,1)\" /><span></span></td>"; trHtml += "<td><span class=\"computeInput1\">0</span></td>"; trHtml += "<td><input type=\"text\" name=\"txtExpression0\" data-area=\"" + item + "\" style=\"width: 200px; \" class=\"input\" onblur=\"computeResult(this,0)\" /><span></span></td>"; trHtml += "<td><span class=\"computeInput0\">0</span></td>"; trHtml += "</tr>"; } } area = new BLL.department().getAreaText(op.op_area); trHtml += "<tr style=\"text-align: center;\">"; trHtml += "<td>" + area + "</td>"; trHtml += "<td>业绩分成(" + area + ")</td>"; trHtml += "<td><input type=\"text\" id=\"txtArea1\" name=\"txtExpression1\" data-area=\"" + op.op_area + "\" disabled=\"disabled\" style=\"width: 200px; \" class=\"input\" value=\"0\" /><span></span></td>"; trHtml += "<td>0</td>"; trHtml += "<td><input type=\"text\" id=\"txtArea0\" name=\"txtExpression0\" data-area=\"" + op.op_area + "\" disabled=\"disabled\" style=\"width: 200px; \" class=\"input\" value=\"0\" /><span></span></td>"; trHtml += "<td>0</td>"; trHtml += "</tr>"; }
private void ShowInfo(int _id) { BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); txtFactArriveDate.Text = model.FactArriveDate.Value.ToString("yyyy-MM-dd"); txtFactBackTime.Text = model.BackTime.Value.ToString("yyyy-MM-dd"); txtFactDispatchCount.Text = model.FactDispatchCount.ToString(); txtFactWeight.Text = model.FactWeight.ToString(); txtReceivedWeight.Text = model.FactWeight.ToString(); txtUnloadingWeight.Text = model.FactWeight.ToString(); txtFactCarriage.Text = model.FactCarriage.ToString(); txtRepayment.Text = model.Advance.ToString(); txtFactRepayment.Text = "0.00"; BLL.Order itemBll = new BLL.Order(); DataTable dt = itemBll.GetPrintList(0, " and A.TransportOrderId = " + model.Id + "", " order by A.Id desc").Tables[0]; foreach (DataRow dr in dt.Rows) { transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">"; transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"OrderId\" value=\"" + dr["Id"].ToString() + "\"/></td>"; transportOrderItems += "<td align=\"left\">" + dr["BillNumber"].ToString() + "</td>"; transportOrderItems += "<td width=\"13%\">" + dr["Shipper"].ToString() + "</td>"; transportOrderItems += "<td width=\"13%\">" + dr["Receiver"].ToString() + "</td>"; transportOrderItems += "<td width=\"12%\">" + dr["GoodsName"].ToString() + "</td>"; transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnitPrice\" class=\"input small\" value=\"" + dr["UnitPrice"].ToString() + "\" style='width:50px'/></td>"; transportOrderItems += "<td width=\"8%\"><input type=\"text\" name=\"Weight\" class=\"input small\" value=\"" + dr["Weight"].ToString() + "\" style='width:50px'/></td>"; transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"Freight\" value=\"" + dr["Freight"].ToString() + "\" style='width:50px'/></td>"; transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"PaidFreight\" value=\"" + dr["PaidFreight"].ToString() + "\" style='width:50px'/></td>"; transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnpaidFreight\" value=\"" + dr["UnpaidFreight"].ToString() + "\" style='width:50px'/></td>"; transportOrderItems += "</tr>"; } BLL.CostItem costItemBll = new BLL.CostItem(); DataTable costItemDT = costItemBll.GetAllList().Tables[0]; foreach (DataRow dr in costItemDT.Rows) { consumptions += "<tr data-value=\"" + dr["Id"].ToString() + "\">"; consumptions += "<td width=\"5%\"><input type=\"hidden\" name=\"costItemName\" value=\"" + dr["Name"].ToString() + "\"/></td>"; consumptions += "<td width=\"5%\">" + dr["Name"].ToString() + "</td>"; consumptions += "<td width=\"50%\">¥<input type=\"text\" name=\"money\" class=\"input small\" value=\"0.00\"/></td>"; consumptions += "</tr>"; } }
private bool DoAdd() { bool result = false; Model.Order model = new Model.Order(); BLL.Order bll = new BLL.Order(); model.Code = "No" + DateTime.Now.ToString("yyyyMMddhhmmss"); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.Shipper = ddlShipper.SelectedItem.Text; model.ShipperLinkMan = txtShipperLinkMan.Text.Trim(); model.ShipperLinkTel = txtShipperLinkTel.Text.Trim(); model.Receiver = ddlReceiver.SelectedItem.Text; model.ReceiverLinkMan = txtReceiverLinkMan.Text.Trim(); model.ReceiverLinkTel = txtReceiverLinkTel.Text.Trim(); model.ContractNumber = txtContractNumber.Text.Trim(); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.Goods = ddlGoods.SelectedItem.Text; model.Unit = txtUnit.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.DispatchedCount = 0.00M; model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.Formula = ddlFormula.SelectedItem.Text; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.TotalPrice = Convert.ToDecimal(txtTotalPrice.Text.Trim()); model.SettleAccountsWay = ddlSettleAccountsWay.SelectedValue; model.Status = 0; model.Remarks = txtRemarks.Text.Trim(); if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加订单:" + model.Code); //记录日志 result = true; } return(result); }
private bool DoAdd() { bool result = false; Model.Order model = new Model.Order(); BLL.Order bll = new BLL.Order(); model.TransportOrderId = this.transportOrderId; model.Code = string.Format("No{0}", DateTime.Now.ToString("yyyyMMddhhmmss")); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.ContractNumber = txtContractNumber.Text.Trim(); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.IsWeightNote = chkIsWeightNote.Checked; model.IsAllotted = chkIsAllotted.Checked; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.Weight = Convert.ToDecimal(txtWeight.Text.Trim()); model.Freight = Convert.ToDecimal(txtFreight.Text.Trim()); model.PaidFreight = Convert.ToDecimal(txtPaidFreight.Text.Trim()); model.UnpaidFreight = Convert.ToDecimal(txtUnpaidFreight.Text.Trim()); model.HandlingCharge = Convert.ToDecimal(txtHandlingCharge.Text.Trim()); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.ShipperId = Convert.ToInt32(ddlShipper.SelectedValue); model.ReceiverId = Convert.ToInt32(ddlReceiver.SelectedValue); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.GoodsId = Convert.ToInt32(ddlGoods.SelectedValue); model.Status = 0; model.Remarks = txtRemarks.Text.Trim(); model.CreateDateTime = DateTime.Now; if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加订单:" + model.Code); //记录日志 result = true; } return(result); }
private void OnDelete() { string sAppend = hV.Value.Trim(); if (!string.IsNullOrEmpty(sAppend)) { string[] orderIds = sAppend.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); if (orderIds.Length > 0) { if (bll == null) { bll = new BLL.Order(); } if (bll.DeleteBatch(orderIds.ToList <string>())) { Bind(); } } } }
private void Bind() { if (!string.IsNullOrEmpty(orderNum)) { IList <Model.OrderInfo> list = new List <Model.OrderInfo>(); if (bll == null) { bll = new BLL.Order(); } Model.OrderInfo model = bll.GetModel(orderNum, Guid.Parse(userId)); if (model != null) { list.Add(model); } rpData.DataSource = list; rpData.DataBind(); GetProductList(model.Products); } }
private void TreeBind(string strWhere) { BLL.Motorcade bll = new BLL.Motorcade(); DataTable dt = bll.GetList(0, strWhere, "Id desc").Tables[0]; ddlMotorcade.Items.Clear(); ddlMotorcade.Items.Add(new ListItem("请选择车队", "")); foreach (DataRow dr in dt.Rows) { this.ddlMotorcade.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } ddlMotorcade.SelectedIndex = 0; string motorcadeName = ddlMotorcade.SelectedValue; BLL.Vehicle vehicleBll = new BLL.Vehicle(); ddlCarNumber.Items.Clear(); ddlCarNumber.Items.Add(new ListItem("请选择车辆", "")); if (!string.IsNullOrEmpty(motorcadeName)) { DataTable vehicledt = vehicleBll.GetList(0, " MotorcadeName = '" + motorcadeName + "' ", "Id desc").Tables[0]; foreach (DataRow dr in vehicledt.Rows) { this.ddlCarNumber.Items.Add(new ListItem(dr["CarCode"].ToString(), dr["CarCode"].ToString())); } } else { DataTable vehicledt = vehicleBll.GetList(0, "", "Id desc").Tables[0]; foreach (DataRow dr in vehicledt.Rows) { this.ddlCarNumber.Items.Add(new ListItem(dr["CarCode"].ToString(), dr["CarCode"].ToString())); } } BLL.Order orderBll = new BLL.Order(); this.rptList.DataSource = orderBll.GetList(" Quantity > DispatchedCount or (IsCharteredCar = 1 and DispatchedCount = 0.00)"); this.rptList.DataBind(); }
private void ShowInfo(int _id) { BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); ddlTransportOrder.SelectedValue = model.TransportOrderId.ToString(); txtAcceptOrderTime.Text = model.AcceptOrderTime.ToString("yyyy-MM-dd"); txtArrivedTime.Text = model.ArrivedTime.ToString("yyyy-MM-dd"); txtContractNumber.Text = model.ContractNumber; txtBillNumber.Text = model.BillNumber; txtWeighbridgeNumber.Text = model.WeighbridgeNumber; txtQuantity.Text = model.Quantity.ToString(); chkIsCharteredCar.Checked = model.IsCharteredCar == 1; chkIsWeightNote.Checked = model.IsWeightNote; chkIsAllotted.Checked = model.IsAllotted; txtUnitPrice.Text = model.UnitPrice.ToString(); txtWeight.Text = model.Weight.ToString(); txtFreight.Text = model.Freight.ToString(); txtPaidFreight.Text = model.PaidFreight.ToString(); txtUnpaidFreight.Text = model.UnpaidFreight.ToString(); txtHandlingCharge.Text = model.HandlingCharge.ToString(); if (!string.IsNullOrEmpty(model.LoadingAddress)) { ddlLoadingAddress.Items.FindByText(model.LoadingAddress).Selected = true; } if (!string.IsNullOrEmpty(model.UnloadingAddress)) { ddlUnloadingAddress.Items.FindByText(model.UnloadingAddress).Selected = true; } ddlShipper.SelectedValue = model.ShipperId.ToString(); ddlReceiver.SelectedValue = model.ReceiverId.ToString(); if (!string.IsNullOrEmpty(model.Haulway)) { ddlHaulway.Items.FindByText(model.Haulway).Selected = true; } txtLoadingCapacityRunning.Text = model.LoadingCapacityRunning.ToString(); txtNoLoadingCapacityRunning.Text = model.NoLoadingCapacityRunning.ToString(); ddlGoods.SelectedValue = model.GoodsId.ToString(); txtRemarks.Text = model.Remarks; }
private bool DoEdit(int _id) { bool result = false; BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.Shipper = ddlShipper.SelectedItem.Text; model.ShipperLinkMan = txtShipperLinkMan.Text.Trim(); model.ShipperLinkTel = txtShipperLinkTel.Text.Trim(); model.Receiver = ddlReceiver.SelectedItem.Text; model.ReceiverLinkMan = txtReceiverLinkMan.Text.Trim(); model.ReceiverLinkTel = txtReceiverLinkTel.Text.Trim(); model.ContractNumber = txtContractNumber.Text.Trim(); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.Goods = ddlGoods.SelectedItem.Text; model.Unit = txtUnit.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.Formula = ddlFormula.SelectedItem.Text; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.TotalPrice = Convert.ToDecimal(txtTotalPrice.Text.Trim()); model.SettleAccountsWay = ddlSettleAccountsWay.SelectedValue; model.Remarks = txtRemarks.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改订单信息:" + model.Code); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); model.TransportOrderId = Convert.ToInt32(ddlTransportOrder.SelectedValue); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.ContractNumber = txtContractNumber.Text.Trim(); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.IsWeightNote = chkIsWeightNote.Checked; model.IsAllotted = chkIsAllotted.Checked; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.Weight = Convert.ToDecimal(txtWeight.Text.Trim()); model.Freight = Convert.ToDecimal(txtFreight.Text.Trim()); model.PaidFreight = Convert.ToDecimal(txtPaidFreight.Text.Trim()); model.UnpaidFreight = Convert.ToDecimal(txtUnpaidFreight.Text.Trim()); model.HandlingCharge = Convert.ToDecimal(txtHandlingCharge.Text.Trim()); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.ShipperId = Convert.ToInt32(ddlShipper.SelectedValue); model.ReceiverId = Convert.ToInt32(ddlReceiver.SelectedValue); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.GoodsId = Convert.ToInt32(ddlGoods.SelectedValue); model.Remarks = txtRemarks.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改订单信息:" + model.Code); //记录日志 result = true; } return(result); }
/// <summary> /// 分配或取消分配 /// </summary> /// <param name="model"></param> /// <param name="manager"></param> /// <returns></returns> public string AddOrCancleDistribution(Model.ReceiptPayDetail model, Model.manager manager) { int ret = 0; Model.Order order = new BLL.Order().GetModel(model.rpd_oid); if (order == null) { return("订单不存在"); } StringBuilder content = new StringBuilder(); Model.business_log logmodel = new Model.business_log(); if (model.rpd_money == 0) { ret = dal.delDistribution(model.rpd_rpid.Value, model.rpd_oid, model.rpd_cid.Value, model.rpd_num); logmodel.ol_title = "取消分配"; } else { //收付款明细申请中的“收付款内容”=预收付款申请的“收付款内容” model.rpd_content = new BLL.ReceiptPay().GetModel(model.rpd_rpid.Value).rp_content; //明细的区域和订单区域保持一致 model.rpd_area = order.personlist.Where(p => p.op_type == 1).ToArray()[0].op_area; dal.delDistribution(model.rpd_rpid.Value, model.rpd_oid, model.rpd_cid.Value, model.rpd_num, "add"); ret = dal.Add(model); logmodel.ol_title = "新增分配"; } if (ret > 0) { logmodel.ol_oid = model.rpd_oid; logmodel.ol_cid = model.rpd_cid.Value; content.Append("金额:" + model.rpd_money + ""); logmodel.ol_content = content.ToString(); logmodel.ol_operateDate = DateTime.Now; new business_log().Add(DTEnums.ActionEnum.Distribute.ToString(), logmodel, manager.user_name, manager.real_name); //记录日志 return("成功"); } return("失败"); }
private void ShowInfo(int _id) { BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); labCode.Text = model.Code; labFactDispatchTime.Text = model.FactDispatchTime.ToString("yyyy-MM-dd"); Model.Driver driver = new BLL.Driver().GetModel(model.DriverId); if (driver != null) { labDriver.Text = driver.RealName; labLinkTel.Text = driver.LinkTel; labCarNumber.Text = driver.CarNumber; } labPayee.Text = model.Payee; labAdvance.Text = model.Advance.ToString(); BLL.Order itemBll = new BLL.Order(); DataTable dt = itemBll.GetPrintList(0, " and A.TransportOrderId = " + model.Id + "", " order by A.Id desc").Tables[0]; foreach (DataRow dr in dt.Rows) { transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">"; transportOrderItems += "<td></td>"; transportOrderItems += "<td align=\"left\">" + dr["Code"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["WeighbridgeNumber"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["GoodsName"].ToString() + "</td>"; transportOrderItems += "<td width=\"6%\">" + dr["Quantity"].ToString() + "</td>"; transportOrderItems += "<td width=\"5%\">" + dr["Weight"].ToString() + "</td>"; transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["UnitPrice"].ToString()) + "</td>"; transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["Freight"].ToString()) + "</td>"; transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["HandlingCharge"].ToString()) + "</td>"; transportOrderItems += "</tr>"; } }
private void ShowInfo(int _id) { BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); labCode.Text = model.Code; labFactDispatchTime.Text = model.FactDispatchTime.ToString("yyyy-MM-dd"); Model.Driver driver = new BLL.Driver().GetModel(model.DriverId); if (driver != null) { labDriver.Text = driver.RealName; labLinkTel.Text = driver.LinkTel; labCarNumber.Text = driver.CarNumber; } labPayee.Text = model.Payee; labAdvance.Text = model.Advance.ToString(); BLL.Order itemBll = new BLL.Order(); DataTable dt = itemBll.GetPrintList(0, " and A.TransportOrderId = " + model.Id + "", " order by A.Id desc").Tables[0]; foreach (DataRow dr in dt.Rows) { transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">"; transportOrderItems += "<td></td>"; transportOrderItems += "<td align=\"left\">" + dr["Code"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["WeighbridgeNumber"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString() + "</td>"; transportOrderItems += "<td width=\"10%\">" + dr["GoodsName"].ToString() + "</td>"; transportOrderItems += "<td width=\"6%\">" + dr["Quantity"].ToString() + "</td>"; transportOrderItems += "<td width=\"5%\">" + dr["Weight"].ToString() + "</td>"; transportOrderItems += "<td width=\"5%\">¥" +string.Format("{0:N2}", dr["UnitPrice"].ToString())+ "</td>"; transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["Freight"].ToString()) + "</td>"; transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["HandlingCharge"].ToString()) + "</td>"; transportOrderItems += "</tr>"; } }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); if (_goods > 0) { ddlGoods.SelectedValue = _goods.ToString(); } if (_customer1 > 0) { ddlCustomer1.SelectedValue = _customer1.ToString(); } if (_customer2 > 0) { ddlCustomer2.SelectedValue = _customer2.ToString(); } if (!string.IsNullOrEmpty(_address1)) { ddlLoadingAddress.SelectedValue = _address1; } if (!string.IsNullOrEmpty(_address2)) { ddlUnloadingAddress.SelectedValue = _address2; } if (!string.IsNullOrEmpty(_beginTime)) { txtBeginTime.Text = _beginTime; } if (!string.IsNullOrEmpty(_endTime)) { txtEndTime.Text = _endTime; } if (_isAllot > 0) { ddlIsAllot.SelectedValue = _isAllot.ToString(); } this.txtKeywords.Text = this.keywords; BLL.Order bll = new BLL.Order(); this.rptList.DataSource = bll.GetFullList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("order_list.aspx", "goods={0}&customer1={1}&customer2={2}&beginTime={3}&endTime={4}&address1={5}&address2={6}&isAllot={7}&keywords={8}&page={9}", _goods.ToString(), _customer1.ToString(), _customer2.ToString(), _beginTime, _endTime, _address1, _address2, _isAllot.ToString(), this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private bool DoAdd() { bool result = false; Model.Order model = new Model.Order(); BLL.Order bll = new BLL.Order(); model.Code = "No" + DateTime.Now.ToString("yyyyMMddhhmmss"); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.Shipper = ddlShipper.SelectedItem.Text; model.ShipperLinkMan = txtShipperLinkMan.Text.Trim(); model.ShipperLinkTel = txtShipperLinkTel.Text.Trim(); model.Receiver = ddlReceiver.SelectedItem.Text; model.ReceiverLinkMan = txtReceiverLinkMan.Text.Trim(); model.ReceiverLinkTel = txtReceiverLinkTel.Text.Trim(); model.ContractNumber = txtContractNumber.Text.Trim(); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.Goods = ddlGoods.SelectedItem.Text; model.Unit = txtUnit.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.DispatchedCount = 0.00M; model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.Formula = ddlFormula.SelectedItem.Text; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.TotalPrice = Convert.ToDecimal(txtTotalPrice.Text.Trim()); model.SettleAccountsWay = ddlSettleAccountsWay.SelectedValue; model.Status = 0; model.Remarks = txtRemarks.Text.Trim(); if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加订单:" + model.Code); //记录日志 result = true; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.Shipper = ddlShipper.SelectedItem.Text; model.ShipperLinkMan = txtShipperLinkMan.Text.Trim(); model.ShipperLinkTel = txtShipperLinkTel.Text.Trim(); model.Receiver = ddlReceiver.SelectedItem.Text; model.ReceiverLinkMan = txtReceiverLinkMan.Text.Trim(); model.ReceiverLinkTel = txtReceiverLinkTel.Text.Trim(); model.ContractNumber = txtContractNumber.Text.Trim(); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.Goods = ddlGoods.SelectedItem.Text; model.Unit = txtUnit.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.Formula = ddlFormula.SelectedItem.Text; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.TotalPrice = Convert.ToDecimal(txtTotalPrice.Text.Trim()); model.SettleAccountsWay = ddlSettleAccountsWay.SelectedValue; model.Remarks = txtRemarks.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改订单信息:" + model.Code); //记录日志 result = true; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); model.FactBackTime = Utils.StrToDateTime(txtFactBackTime.Text.Trim(), DateTime.Now); model.Repayment = Utils.StrToDecimal(txtRepayment.Text.Trim(), 0.00M); model.FactRepayment = Utils.StrToDecimal(txtFactRepayment.Text.Trim(), 0.00M); model.Carriage = Utils.StrToDecimal(txtCarriage.Text.Trim(), 0.00M); model.Status = 2; string[] itemIds = Request.Params.GetValues("transportOrderItemId"); string[] factDispatchCounts = Request.Params.GetValues("factDispatchCount"); string[] factReceivedCounts = Request.Params.GetValues("factReceivedCount"); string[] totalPrices = Request.Params.GetValues("totalPrice"); string[] roundStatus = Request.Params.GetValues("roundStatus"); string[] costItemNames = Request.Params.GetValues("costItemName"); string[] monies = Request.Params.GetValues("money"); List<Model.TransportOrderItem> item_list = new List<Model.TransportOrderItem>(); BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem(); Model.TransportOrderItem item; List<Model.Order> orders = new List<Model.Order>(); BLL.Order orderBll = new BLL.Order(); Model.Order order; for (int i = 0; i < itemIds.Length; i++) { item = itemBll.GetModel(Utils.StrToInt(itemIds[i], 0)); if (item != null) { decimal oldFactDispatchCount = item.FactDispatchCount; decimal newFactDispatchCount = Utils.StrToDecimal(factDispatchCounts[i], 0.00M); order = orderBll.GetModel(item.OrderId); order.DispatchedCount += newFactDispatchCount - oldFactDispatchCount; orders.Add(order); item.FactDispatchCount = newFactDispatchCount; item.FactReceivedCount = Utils.StrToDecimal(factReceivedCounts[i], 0.00M); item.TotalPrice = Utils.StrToDecimal(totalPrices[i], 0.00M); item.RoundStatus = roundStatus[i]; item_list.Add(item); } } List<Model.Consumption> consumption_list = new List<Model.Consumption>(); for (int i = 0; i < costItemNames.Length; i++) { Model.Consumption consumption = new Model.Consumption(); consumption.Name = costItemNames[i]; consumption.Money = Utils.StrToDecimal(monies[i], 0.00M); consumption.TransportOrderId = _id; consumption_list.Add(consumption); } if (bll.Update(model, item_list, consumption_list, orders)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回车报账信息:" + model.Code); //记录日志 result = true; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); model.FactArriveDate = Utils.StrToDateTime(txtFactArriveDate.Text.Trim(), DateTime.Now); model.FactBackTime = Utils.StrToDateTime(txtFactBackTime.Text.Trim(), DateTime.Now); model.Repayment = Utils.StrToDecimal(txtRepayment.Text.Trim(), 0.00M); model.FactRepayment = Utils.StrToDecimal(txtFactRepayment.Text.Trim(), 0.00M); model.FactDispatchCount = Utils.StrToDecimal(txtFactDispatchCount.Text.Trim(), 0.00M); model.FactWeight = Utils.StrToDecimal(txtFactWeight.Text.Trim(), 0.00M); model.ReceivedWeight = Utils.StrToDecimal(txtReceivedWeight.Text.Trim(), 0.00M); model.UnloadingWeight = Utils.StrToDecimal(txtUnloadingWeight.Text.Trim(), 0.00M); model.FactCarriage = Utils.StrToDecimal(txtFactCarriage.Text.Trim(), 0.00M); model.Status = 3; string[] ids = Request.Params.GetValues("OrderId"); string[] unitPrices = Request.Params.GetValues("UnitPrice"); string[] weights = Request.Params.GetValues("Weight"); string[] freights = Request.Params.GetValues("Freight"); string[] paidFreights = Request.Params.GetValues("PaidFreight"); string[] unpaidFreights = Request.Params.GetValues("UnpaidFreight"); string[] costItemNames = Request.Params.GetValues("costItemName"); string[] monies = Request.Params.GetValues("money"); List<Model.Order> item_list = new List<Model.Order>(); BLL.Order orderBLL = new BLL.Order(); Model.Order item; if (ids != null && unitPrices != null && weights != null && freights != null && paidFreights != null && unpaidFreights != null && ids.Length == unitPrices.Length && ids.Length == weights.Length && ids.Length == freights.Length && ids.Length == paidFreights.Length && ids.Length == unpaidFreights.Length && ids.Length > 0) { for (int i = 0; i < ids.Length; i++) { item = orderBLL.GetModel(Utils.StrToInt(ids[i], 0)); if (item != null) { item.UnitPrice = Utils.StrToDecimal(unitPrices[i], 0.00M); item.Weight = Utils.StrToDecimal(weights[i], 0.00M); item.Freight = Utils.StrToDecimal(freights[i], 0.00M); item.PaidFreight = Utils.StrToDecimal(paidFreights[i], 0.00M); item.UnpaidFreight = Utils.StrToDecimal(unpaidFreights[i], 0.00M); item_list.Add(item); } } } List<Model.Consumption> consumption_list = new List<Model.Consumption>(); if (costItemNames != null && monies != null && costItemNames.Length == monies.Length && costItemNames.Length > 0) { for (int i = 0; i < costItemNames.Length; i++) { Model.Consumption consumption = new Model.Consumption(); consumption.Name = costItemNames[i]; consumption.Money = Utils.StrToDecimal(monies[i], 0.00M); consumption.TransportOrderId = _id; consumption_list.Add(consumption); } } if (bll.Update(model, item_list, consumption_list)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回车报账信息:" + model.Code); //记录日志 result = true; } return result; }
/// <summary> /// Saves the whole transaction for /// </summary> /// <param name="orderID">The order ID.</param> /// <param name="dvOutstandingPickList">The dv outstanding pick list.</param> /// <param name="remark">The remark.</param> /// <param name="issuedBy">The issued by.</param> /// <param name="etCurrentDate">The et current date.</param> /// <returns></returns> /// <exception cref="System.Exception"></exception> public static Order SaveIssueTransaction(int orderID, ref DataView dvOutstandingPickList, string remark, string issuedBy, DateTime etCurrentDate) { // Add the IssueDocID field dvOutstandingPickList.Table.Columns.Add("IssueDocID"); PickList plst = new PickList(); IssueDoc issDoc = new IssueDoc(); ReceiveDoc recDoc = new ReceiveDoc(); BLL.Order ord = new BLL.Order(); ord.LoadByPrimaryKey(orderID); plst.LoadByOrderID(ord.ID); foreach (DataRowView drv in dvOutstandingPickList) { // Pseudo: // for each row in the picklist // undate the issue document // subtract the issued quantity from the receive doc // subtract the issued quantity from recieve pallet // subtract the issued the reserved quantity irregardless of the quantity issued. //Saving the new Issue issue if (Convert.ToDecimal(drv["BUPICKED"]) == 0) { continue; } if (Convert.ToDecimal(drv["SKUPicked"]) != Convert.ToDecimal(drv["SKUTOPICK"])) { drv["Cost"] = Convert.ToDecimal(drv["SKUPicked"]) * Convert.ToDecimal(drv["UnitPrice"]); } // Select the receive doc that is associated with this issue. recDoc.LoadByPrimaryKey(Convert.ToInt32(drv["ReceiveDocID"])); issDoc.AddNew(); issDoc.StoreId = Convert.ToInt32(drv["StoreID"]); issDoc.RefNo = ord.RefNo; if (!ord.IsColumnNull("RequestedBy")) issDoc.ReceivingUnitID = ord.RequestedBy; // TOFIX: // TODO: // Lord have mercy kind of hack to avoid the feb date problem // this needs to be fixed for pagume also issDoc.Date = etCurrentDate; issDoc.EurDate = DateTimeHelper.ServerDateTime; issDoc.RecievDocID = Convert.ToInt32(drv["ReceiveDocID"]); issDoc.IsApproved = true; issDoc.IsTransfer = false; issDoc.Remark = remark; issDoc.ItemID = Convert.ToInt32(drv["ItemID"]); issDoc.Quantity = Convert.ToDecimal(drv["BUPICKED"]); issDoc.NoOfPack = Convert.ToDecimal(drv["SKUPICKED"]); issDoc.QtyPerPack = Convert.ToInt32(drv["SKUBU"]); issDoc.BatchNo = drv["BatchNumber"].ToString(); issDoc.UnitID = recDoc.UnitID; issDoc.ManufacturerID = recDoc.ManufacturerId; if (drv["Cost"] != DBNull.Value) { issDoc.Cost = Convert.ToDouble(drv["Cost"]); issDoc.SellingPrice = Convert.ToDecimal(drv["UnitPrice"]); if (!recDoc.IsColumnNull("Cost")) { issDoc.UnitCost = Convert.ToDecimal(recDoc.Cost); } } issDoc.OrderID = orderID; issDoc.IssuedBy = issuedBy; // TODO: is this the right place where we need to pick the physical store ID from? // check it against the receipt pallet physical store. if (!recDoc.IsColumnNull("PhysicalStoreID")) { issDoc.PhysicalStoreID = recDoc.PhysicalStoreID; } if (!recDoc.IsColumnNull("InventoryPeriodID")) { //Todo: Remove for Inventory issDoc.InventoryPeriodID = recDoc.InventoryPeriodID; } if (!recDoc.IsColumnNull("Margin")) { issDoc.Margin = (decimal)recDoc.Margin; } //Replaced by issDoc.PLDetailID = Convert.ToInt32(drv["PLDetailID"]); BLL.Balance bal = new Balance(); BLL.ReceiveDoc rd = new ReceiveDoc(); rd.LoadByPrimaryKey(issDoc.RecievDocID); decimal currentBalance = bal.GetSoh(issDoc.ItemID, rd.UnitID, issDoc.StoreId, issDoc.Date.Month, issDoc.Date.Year); if (currentBalance < issDoc.NoOfPack) { throw new Exception(string.Format("The item {0} is not available in {1} Qty.", drv["FullItemName"].ToString(), issDoc.NoOfPack)); } // This is a field that is not applicable on the hub edition // It is about the dispensing unit quantity and there is no such thing as Dispensing unit // in the hub edition issDoc.DUSOH = 0; issDoc.RecomendedQty = 0;// ((recQty > 0) ? Convert.ToInt64(recQty) : 0); // End DU issDoc.DispatchConfirmed = false; issDoc.Save(); drv["IssueDocID"] = issDoc.ID; // updating the receiving doc //long prevQuantityLeft = recDoc.QuantityLeft; recDoc.QuantityLeft = recDoc.QuantityLeft - issDoc.Quantity; if (recDoc.QuantityLeft < 0) { //Possibly the wrong ReceiveDoc Entry chosen BLL.Item itm = new Item(); itm.LoadByPrimaryKey(recDoc.ItemID); throw new Exception(string.Format("Quantity problem detected for the item {0}", itm.FullItemName)); } //long recDoc.Out = (recDoc.QuantityLeft == 0) ? true : false; recDoc.Save(); ReceivePallet rp = new ReceivePallet(); int id = Convert.ToInt32(drv["ReceivePalletID"]); rp.LoadByPrimaryKey(id); if (rp.IsColumnNull("Balance")) { rp.Balance = rp.ReceivedQuantity; } rp.Balance -= issDoc.Quantity; if (rp.Balance < 0) { BLL.Item itm = new Item(); itm.LoadByPrimaryKey(recDoc.ItemID); throw new Exception(string.Format("Quantity problem detected for the item {0}", itm.FullItemName)); } decimal totReservedQty = Convert.ToDecimal(drv["QuantityInBU"]); if (rp.IsColumnNull("ReservedStock")) rp.ReservedStock = 0; rp.ReservedStock -= totReservedQty; if (rp.ReservedStock < 0) //If there has been a quantity problem somewhere rp.ReservedStock = 0; rp.Save(); } plst.IsConfirmed = true; ord.ChangeStatus(OrderStatus.Constant.ISSUED, CurrentContext.UserId); plst.Save(); ord.Save(); return ord; }
//~ This Method is Obsoleted ~// public static bool SaveBackOrderToDatabase(BLL.Order _order) { var _orderDetail = new OrderDetail(); _orderDetail.LoadAllByOrderID(_order.ID); MyGeneration.dOOdads.TransactionMgr mgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { mgr.BeginTransaction(); var or = new BLL.Order(); or.AddNew(); or.RefNo = Order.GetNextOrderReference(); or.SetColumn("OrderTypeID", _order.GetColumn("OrderTypeID")); or.SetColumn("HCTSReferenceID", _order.GetColumn("HCTSReferenceID")); or.OrderStatusID = OrderStatus.Constant.DRAFT_WISHLIST; or.RequisitionTypeID = RequisitionType.CONSTANTS.DEMAND; or.Remark = _order.ID.ToString(); //Store the Original ID here for the backorder. We need to have a standard way of marking backorders. or.EurDate = or.Date = DateTimeHelper.ServerDateTime; //Both fields are assigned dates. or.RequestedBy = _order.RequestedBy; or.FilledBy = _order.FilledBy; or.LetterNo = _order.LetterNo; or.PaymentTypeID = _order.PaymentTypeID; or.ContactPerson = _order.ContactPerson; or.FromStore = _order.FromStore; or.FiscalYearID = FiscalYear.Current.ID; or.OrderTypeID = _order.OrderTypeID == OrderType.CONSTANTS.PLITS ? _order.OrderTypeID : OrderType.CONSTANTS.BACK_ORDER; or.Save(); or.LogRequisitionStatus(or.ID,null,OrderStatus.Constant.DRAFT_WISHLIST,CurrentContext.UserId); _orderDetail.Rewind(); var orderDetail = new OrderDetail(); while (!_orderDetail.EOF) { if (_orderDetail.ApprovedQuantity >= _orderDetail.Quantity) { _orderDetail.MoveNext(); continue; //Backorder is only for those with approved quantity less than the requested quantity. } orderDetail.AddNew(); orderDetail.ItemID = _orderDetail.ItemID; orderDetail.OrderID = or.ID; orderDetail.Pack = (_orderDetail.Quantity - _orderDetail.ApprovedQuantity) / _orderDetail.QtyPerPack; orderDetail.QtyPerPack = _orderDetail.QtyPerPack; orderDetail.Quantity = orderDetail.Pack * orderDetail.QtyPerPack; orderDetail.SetColumn("HACTOrderDetailID", _orderDetail.GetColumn("HACTOrderDetailID")); orderDetail.UnitID = _orderDetail.UnitID; _orderDetail.MoveNext(); } orderDetail.Save(); mgr.CommitTransaction(); return true; } catch (Exception exp) { mgr.RollbackTransaction(); return false; } }
/// <summary> /// /// </summary> /// <param name="ordID"></param> /// <param name="returnToApproval">When false, the order is cancelled completely</param> /// <returns></returns> public static bool ReleaseReservation(int ordID, bool returnToApproval) { BLL.Order ord = new BLL.Order(); ord.LoadByPrimaryKey(ordID); MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { transaction.BeginTransaction(); if (ord.RowCount > 0 && (ord.OrderStatusID == OrderStatus.Constant.PICK_LIST_GENERATED || ord.OrderStatusID == OrderStatus.Constant.PICK_LIST_CONFIRMED)) { ord.ReleaseReservation(); if (returnToApproval) { ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED,CurrentContext.UserId); } else { ord.ChangeStatus(OrderStatus.Constant.CANCELED,CurrentContext.UserId); } ord.Save(); } transaction.CommitTransaction(); return true; } catch (Exception exp) { transaction.RollbackTransaction(); throw (exp); } }
private void RptBind() { string sql = " Status >= 2 "; if (!string.IsNullOrEmpty(_beginTime)) { sql += " AND FactBackTime >= '" + _beginTime + "' "; txtBeginTime.Text = _beginTime; } else { sql += " AND FactBackTime >= '" + DateTime.Now.AddMonths(-1) + "' "; txtBeginTime.Text = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"); } if (!string.IsNullOrEmpty(_endTime)) { sql += " AND FactBackTime <= '" + _endTime + "' "; txtEndTime.Text = _endTime; } else { sql += " AND FactBackTime <= '" + DateTime.Now + "' "; txtEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd"); } string ids = string.Empty; BLL.TransportOrder bll = new BLL.TransportOrder(); DataSet tods = bll.GetTotalList(sql); if (tods != null && tods.Tables[0].Rows.Count > 0) { foreach (DataRow dr in tods.Tables[0].Rows) { ids += dr["Id"].ToString() + ","; totalFactRepayment += Utils.StrToDecimal(dr["FactRepayment"].ToString(), 0.00M); totalCarriage += Utils.StrToDecimal(dr["FactCarriage"].ToString(), 0.00M); totalAdvance += Utils.StrToDecimal(dr["Advance"].ToString(), 0.00M); } if (ids.EndsWith(",")) { ids = ids.TrimEnd(','); } } if (!string.IsNullOrEmpty(ids)) { BLL.Order itemBll = new BLL.Order(); DataSet itemds = itemBll.GetList(" TransportOrderId IN (" + ids + ") "); if (itemds != null && itemds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in itemds.Tables[0].Rows) { totalIncome += Utils.StrToDecimal(dr["Freight"].ToString(), 0.00M); } } BLL.Consumption cBll = new BLL.Consumption(); DataSet cds = cBll.GetSumList(" TransportOrderId IN (" + ids + ") "); if (cds != null && cds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in cds.Tables[0].Rows) { totalCostItem += Utils.StrToDecimal(dr["TotalMoney"].ToString(), 0.00M); costItem += "<tr><td width=\"20%\" style=\"text-align:right\">"+dr["Name"].ToString()+" : </td>"; costItem += "<td>¥" + string.Format("{0:N2}", dr["TotalMoney"]) + "</td></tr>"; } } } totalGain = totalIncome + totalFactRepayment - totalCarriage - totalAdvance - totalCostItem; }
private bool DoAdd() { bool result = false; Model.Order model = new Model.Order(); BLL.Order bll = new BLL.Order(); model.TransportOrderId = Convert.ToInt32(ddlTransportOrder.SelectedValue); model.Code = string.Format("No{0}", DateTime.Now.ToString("yyyyMMddhhmmss")); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.ContractNumber = txtContractNumber.Text.Trim(); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.IsWeightNote = chkIsWeightNote.Checked; model.IsAllotted = chkIsAllotted.Checked; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.Weight = Convert.ToDecimal(txtWeight.Text.Trim()); model.Freight = Convert.ToDecimal(txtFreight.Text.Trim()); model.PaidFreight = Convert.ToDecimal(txtPaidFreight.Text.Trim()); model.UnpaidFreight = Convert.ToDecimal(txtUnpaidFreight.Text.Trim()); model.HandlingCharge = Convert.ToDecimal(txtHandlingCharge.Text.Trim()); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.ShipperId = Convert.ToInt32(ddlShipper.SelectedValue); model.ReceiverId = Convert.ToInt32(ddlReceiver.SelectedValue); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.GoodsId = Convert.ToInt32(ddlGoods.SelectedValue); model.Status = 0; model.Remarks = txtRemarks.Text.Trim(); model.CreateDateTime = DateTime.Now; if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加订单:" + model.Code); //记录日志 result = true; } return result; }
private bool DoAdd() { bool result = false; Model.TransportOrder model = new Model.TransportOrder(); BLL.TransportOrder bll = new BLL.TransportOrder(); string[] orderIds = Request.Params.GetValues("orderId"); string[] factDispatchCounts = Request.Params.GetValues("factDispatchCount"); if (orderIds == null) { JscriptMsg("请填写运输项信息!", "", "Error"); return false; } model.Code = "No" + DateTime.Now.ToString("yyyyMMddhhmmss"); model.DispatchTime = Convert.ToDateTime(txtDispatchTime.Text.Trim()); model.FactDispatchTime = DateTime.Now; model.BackTime = Convert.ToDateTime(txtBackTime.Text.Trim()); model.FactBackTime = DateTime.Now; model.MotorcadeName = ddlMotorcade.SelectedValue; model.CarNumber = ddlCarNumber.SelectedValue; model.Driver = txtDriver.Text.Trim(); model.Remarks = txtRemarks.Text.Trim(); List<Model.TransportOrderItem> item_list = new List<Model.TransportOrderItem>();//运输子项 List<Model.Order> order_list = new List<Model.Order>();//订单 BLL.Order orderBll = new BLL.Order(); for (int i = 0; i < orderIds.Length; i++) { Model.Order order = orderBll.GetModel(Convert.ToInt32(orderIds[i])); if (order != null) { Model.TransportOrderItem item = new Model.TransportOrderItem(); item.OrderId = order.Id; item.OrderCode = order.Code; item.ContractNumber = order.ContractNumber; item.BillNumber = order.BillNumber; item.Shipper = order.Shipper; item.Receiver = order.Receiver; item.LoadingAddress = order.LoadingAddress; item.UnloadingAddress = order.UnloadingAddress; item.Goods = order.Goods; item.Unit = order.Unit; item.DispatchCount = order.Quantity; item.FactDispatchCount = Convert.ToDecimal(factDispatchCounts[i]); item.FactReceivedCount = item.FactDispatchCount; item.CompensationCosts = 0.00M; item.MyCosts = 0.00m; item.Haulway = order.Haulway; item.LoadingCapacityRunning = order.LoadingCapacityRunning; item.NoLoadingCapacityRunning = order.NoLoadingCapacityRunning; item.Formula = order.Formula; item.UnitPrice = order.UnitPrice; item.TotalPrice = order.TotalPrice; item.CompanyPrice = item.TotalPrice; item_list.Add(item); // int status = (order.IsCharteredCar == 1 || ((order.DispatchedCount + item.FactDispatchCount) == order.Quantity)) ? 1 : 0; //order.Status = status; order.DispatchedCount = order.DispatchedCount + item.FactDispatchCount; order_list.Add(order); } } if (bll.Add(model,item_list,order_list) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加运输单:" + model.Code); //记录日志 result = true; } return result; }
public static Order SaveOrderToDB(int Status, int userID, int? orderID, int facilityID, int paymentType, int modeID, string remarks, string letterNumber, string contactPerson, DataView _dvOrderTable) { MyGeneration.dOOdads.TransactionMgr mgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { mgr.BeginTransaction(); BLL.Order or = new BLL.Order(); if (orderID == null) { or.AddNew(); or.RefNo = Order.GetNextOrderReference(); or.OrderTypeID = OrderType.CONSTANTS.STANDARD_ORDER; or.FiscalYearID = FiscalYear.Current.ID; } else { or.LoadByPrimaryKey(orderID.Value); } var oldOrderStatus = or.IsColumnNull("OrderStatusID") ? (int?)null : or.OrderStatusID; or.OrderStatusID = Status; or.RequisitionTypeID = RequisitionType.CONSTANTS.DEMAND; or.Remark = remarks; or.EurDate = or.Date = DateTimeHelper.ServerDateTime; //Both fields are assigned dates. or.RequestedBy = facilityID; or.FilledBy = userID; or.LetterNo = letterNumber; or.PaymentTypeID = paymentType; or.ContactPerson = contactPerson; or.FromStore = modeID; or.Save(); or.LogRequisitionStatus(or.ID, oldOrderStatus, Status, CurrentContext.UserId); //Log OrderStatus Change // this is a kind of initializing the data table. OrderDetail ord = new OrderDetail(); foreach (DataRowView r in _dvOrderTable) { int itemID = Convert.ToInt32(r["ItemID"]); int unitID = Convert.ToInt32(r["UnitID"]); ord.LoadByItemUnit(or.ID, itemID, unitID); if (ord.RowCount == 0) { ord.AddNew(); } ord.OrderID = or.ID; ord.ItemID = itemID; if (r["Pack"] != DBNull.Value) { ord.Pack = Convert.ToDecimal(r["Pack"]); } if (r["QtyPerPack"] != DBNull.Value) { ord.QtyPerPack = Convert.ToInt32(r["QtyPerPack"]); } if (r["StockOnHand"] != DBNull.Value) { ord.StockOnHand = Convert.ToDecimal(r["StockOnHand"]); } //if (r["ExpiredStock"] != DBNull.Value) //{ // ord.ExpiredStock = Convert.ToDecimal(r["ExpiredStock"]); //} //if (r["DamagedStock"] != DBNull.Value) //{ // ord.DamagedStock = Convert.ToDecimal(r["DamagedStock"]); //} ord.Quantity = Convert.ToDecimal(r["Quantity"]); ord.UnitID = unitID; //ord.StoreID = or.FromStore; ord.Save(); } //this.LogActivity("Save-Requisition", ord.ID); mgr.CommitTransaction(); return or; } catch (Exception exp) { mgr.RollbackTransaction(); throw; } //ResetOrder(); }
public static int SavePLITSApprovedOrderToDatabase(int Status, int userID, int? plitsOrderID, int facilityID, int paymentType, int modeID, string remarks, string letterNumber, string contactPerson, BLL.OrderDetail _PLITSOrderDetail) { int hcmisorderid; MyGeneration.dOOdads.TransactionMgr mgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { mgr.BeginTransaction(); BLL.Order or = new BLL.Order(); or.AddNew(); or.RefNo = Order.GetNextOrderReference(); or.OrderTypeID = OrderType.CONSTANTS.PLITS; or.HCTSReferenceID = plitsOrderID.Value; or.OrderStatusID = Status; or.RequisitionTypeID = RequisitionType.CONSTANTS.DEMAND; or.Remark = remarks; or.EurDate = or.Date = DateTimeHelper.ServerDateTime; //Both fields are assigned dates. var institution = new Institution(); institution.LoadBySN(facilityID); or.RequestedBy = institution.ID; or.FilledBy = userID; or.LetterNo = letterNumber; or.PaymentTypeID = paymentType; or.ContactPerson = contactPerson; or.FromStore = modeID; or.FiscalYearID = FiscalYear.Current.ID; or.Save(); or.LogRequisitionStatus(or.ID,null,Status, CurrentContext.UserId); //Log OrderStatus change _PLITSOrderDetail.Rewind(); while (!_PLITSOrderDetail.EOF) { _PLITSOrderDetail.OrderID = or.ID; _PLITSOrderDetail.MoveNext(); } _PLITSOrderDetail.Save(); hcmisorderid = or.ID; //this.LogActivity("Save-Requisition", ord.ID); mgr.CommitTransaction(); } catch (Exception exp) { mgr.RollbackTransaction(); return 0; throw (exp); } //ResetOrder(); return hcmisorderid; }
private bool DoEdit(int _id) { bool result = false; BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); model.TransportOrderId = Convert.ToInt32(ddlTransportOrder.SelectedValue); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.ContractNumber = txtContractNumber.Text.Trim(); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.IsWeightNote = chkIsWeightNote.Checked; model.IsAllotted = chkIsAllotted.Checked; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.Weight = Convert.ToDecimal(txtWeight.Text.Trim()); model.Freight = Convert.ToDecimal(txtFreight.Text.Trim()); model.PaidFreight = Convert.ToDecimal(txtPaidFreight.Text.Trim()); model.UnpaidFreight = Convert.ToDecimal(txtUnpaidFreight.Text.Trim()); model.HandlingCharge = Convert.ToDecimal(txtHandlingCharge.Text.Trim()); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.ShipperId = Convert.ToInt32(ddlShipper.SelectedValue); model.ReceiverId = Convert.ToInt32(ddlReceiver.SelectedValue); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.GoodsId = Convert.ToInt32(ddlGoods.SelectedValue); model.Remarks = txtRemarks.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改订单信息:" + model.Code); //记录日志 result = true; } return result; }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); //if (_goods > 0) //{ // ddlGoods.SelectedValue = _goods.ToString(); //} //if (_customer1 > 0) //{ // ddlCustomer1.SelectedValue = _customer1.ToString(); //} //if (_customer2 > 0) //{ // ddlCustomer2.SelectedValue = _customer2.ToString(); //} //if (!string.IsNullOrEmpty(_beginTime)) //{ // txtBeginTime.Text = _beginTime; //} //if (!string.IsNullOrEmpty(_endTime)) //{ // txtEndTime.Text = _endTime; //} //this.txtKeywords.Text = this.keywords; BLL.Order bll = new BLL.Order(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("dialog_order_list.aspx", "goods={0}&customer1={1}&customer2={2}&beginTime={3}&endTime={4}&keywords={5}&page={6}&transportOrderId=" + this.transportOrderId + "", _goods.ToString(), _customer1.ToString(), _customer2.ToString(), _beginTime, _endTime, this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }