protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string suigongdan = Request.QueryString["suigongdan"];//随工单号 string PrintCount = Request.QueryString["PrintCount"];//随工单打印数量 string orderNum = Request.QueryString["orderNum"];//订单编号 string proType = Request.QueryString["proType"];//产品型号 if (!string.IsNullOrEmpty(orderNum)&&!string.IsNullOrEmpty(proType)) { string strWhere = string.Format(" and orderNum='{0}' and proType='{1}' ",orderNum,proType); orderDetail = ProOrdersDetailBLL.GetModelByWhere(strWhere); if (orderDetail != null) { lblpiHao.Text = orderDetail.PiHao; try { if (orderDetail.PlanSendTime != null && Convert.ToDateTime(orderDetail.PlanSendTime).ToString("yyyy-MM-dd") != "0001-01-01") { lblplanSendTime.Text = Convert.ToDateTime(orderDetail.PlanSendTime).ToString("yyyy-MM-dd"); } } catch (Exception) { } lblproductAddress.Text = orderDetail.ProductAddress; lblproNum.Text = orderDetail.proNum.ToString(); lblproType.Text = orderDetail.proType; //随工单号 lblSuiGongDan.Text = suigongdan; //随工单打印数量 lblPrintCount.Text = PrintCount; //加载订单基本信息 orderMod = ProOrdersBLL.GetModel(orderDetail.orderNum); if (orderMod != null) { txtcustomManager.Text = orderMod.customManager; txtcustomNum.Text = orderMod.customNum; txtcustomOrderNum.Text = orderMod.customOrderNum; txtcustomWLBH.Text = orderMod.customWLBH; txtheTongNum.Text = orderMod.heTongNum; txtorderNum.Text = orderMod.orderNum; txtremark.Text = orderMod.remark; var db = new Web.Model.OrderPrintEntities(); var intorderDetailId = orderDetail.orderDetailId; var gt_order = db.proOrders.FirstOrDefault(r => r.orderId == orderMod.orderId); if (!string.IsNullOrEmpty(gt_order.发货状态)) { lbl发货状态.Text = gt_order.发货状态; } } } } } }
public static int isExistGuigeshu(string proType) { using (var db = new Web.Model.OrderPrintEntities()) { return db.GuiGeShu.Count(r => r.productNo == proType) > 0 ? 1 : 0; } //int num = 0; //GuiGeShuMOD mod = GuiGeShuBLL.GetmodByid(proType); //if (mod != null) //{ // num = 1; //} //return num; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //这里是判断是否已经登陆 (先加一个测试一下) var authCookie = Request.Cookies[ FormsAuthentication.FormsCookieName]; if (authCookie == null) { //Cookie中不存在,表示没有登陆,需要跳转到登陆页面 Response.Redirect("/Login.aspx"); return; } if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "") { orderDetailId = Request.QueryString["id"].ToString(); orderDetail = ProOrdersDetailBLL.GetModel(Convert.ToInt32(orderDetailId)); if (Request.QueryString["opr"] == "print") { // // 点击了“打印” // // txtproNum.Text = Request.QueryString["txtproNum"]; orderDetail.PiHao = Request.QueryString["txtpiHao"]; try { orderDetail.PlanSendTime = Convert.ToDateTime(Request.QueryString["txtplanSendTime"].Trim()); } catch (Exception) { } orderDetail.ProductAddress = Request.QueryString["txtproductAddress"]; } if (orderDetail != null) { txtpiHao.Text = orderDetail.PiHao; try { if (orderDetail.PlanSendTime != null && Convert.ToDateTime(orderDetail.PlanSendTime).ToString("yyyy-MM-dd") != "0001-01-01") { txtplanSendTime.Text = Convert.ToDateTime(orderDetail.PlanSendTime).ToString("yyyy-MM-dd"); } } catch (Exception) { } txtproductAddress.Text = orderDetail.ProductAddress; lblproNum.Text = orderDetail.proNum.ToString(); txtproType.Text = orderDetail.proType; #region 生成随工单号 //随工单号 string date = DateTime.Now.ToString("yyyyMM"); string str = ""; if (SGDRecordBLL.GetSuigondanMax(date) != null) { str = SGDRecordBLL.GetSuigondanMax(date).ToString(); } if (str == "") { txtwithWorkNo.Text = DateTime.Now.ToString("yyyyMMdd") + "-1-" + DateTime.Now.ToString("ffff"); } else { try { txtwithWorkNo.Text = DateTime.Now.ToString("yyyyMMdd") + "-" + (Convert.ToInt32(str.Split('-')[1]) + 1) + "-" + DateTime.Now.ToString("ffff"); } catch (Exception ex) { throw new Exception("错误的字串:" + str); } } #endregion //加载订单内容信息 orderMod = ProOrdersBLL.GetModel(orderDetail.orderNum); if (orderMod != null) { txtcustomManager.Text = orderMod.customManager; txtcustomNum.Text = orderMod.customNum; txtcustomOrderNum.Text = orderMod.customOrderNum; txtcustomWLBH.Text = orderMod.customWLBH; txtheTongNum.Text = orderMod.heTongNum; txtorderNum.Text = orderMod.orderNum; txtremark.Text = orderMod.remark; var db = new Web.Model.OrderPrintEntities(); var intorderDetailId = Int32.Parse(orderDetailId); var gt_order = db.proOrders.FirstOrDefault(r => r.orderId == orderMod.orderId); if (!string.IsNullOrEmpty(gt_order.发货状态))//发货状态显示判断 { lbl发货状态.Text = gt_order.发货状态; } } } } } }