예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "")
            {
                string orderNum = Request.QueryString["id"].ToString();
                //加载订单基本信息
                orderMod = ProOrdersBLL.GetModel(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;
                    txtYijiekuanMoney.Text = orderMod.YijiekuanMoney.ToString();
                    txtYikaipiaoMoney.Text = orderMod.YikaipiaoMoney.ToString();
                }
                //加载订单产品
                string strWhere = " and orderNum='" + orderNum + "'";
                DataSet ds = ProOrdersDetailBLL.GetList(strWhere);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    rptYongpin.DataSource = ds;
                    rptYongpin.DataBind();
                    txtTRLastIndex.Value = ds.Tables[0].Rows.Count.ToString();
                }
                else
                {
                    txtTRLastIndex.Value = "0";
                }
                //查看客户是否客户提供合同范本,如客户提供,打印合同按钮隐藏
                customer = CustomerManageBLL.GetcustomerByid(orderMod.customNum);
                if (customer != null)
                {
                    if (customer.IsFanben == 0)
                    {
                        IBtn_Print.Visible = false;
                    }
                    else
                    {
                        IBtn_Print.Visible = true;
                    }
                }
                //订单号、客户编号不允许修改
                txtorderNum.Enabled = false;
                txtcustomNum.Enabled = false;
            }
        }
    }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
         {
             int id = Convert.ToInt32(Request.QueryString["id"]);
             customer = CustomerManageBLL.GetcustomerByid(id);
             if (customer != null)
             {
                 //加载客户信息
                 txtbackMethod.Text = customer.BackMethod;
                 txtcompanyAddress.Text = customer.CompanyAddress;
                 txtcompanyName.Text = customer.CompanyName;
                 txtcontacts.Text = customer.Contacts;
                 txtcustomerNo.Text = customer.CustomerNo;
                 txtdescription.Text = customer.Description;
                 txtdiscount.Text = customer.Discount.ToString();
                 txtInvoiceMethod.Text = customer.InvoiceMethod;
                 switch (customer.IsFanben)
                 {
                     case 0:
                         rdoIsFanbenYes.Checked = true;
                         rdoIsFanbenNo.Checked = false;
                         break;
                     case 1:
                         rdoIsFanbenNo.Checked = true;
                         rdoIsFanbenYes.Checked = false;
                         break;
                 }
                 switch (customer.IsShowPrice)
                 {
                     case 0:
                         rdoIsShowPriceYes.Checked = true;
                         rdoIsShowPriceNo.Checked = false;
                         break;
                     case 1:
                         rdoIsShowPriceNo.Checked = true;
                         rdoIsShowPriceYes.Checked = false;
                         break;
                 }
                 txtmodifyPriceRecord.Text = customer.ModifyPriceRecord;
                 txtotherDangAn.Text = customer.OtherDangAn;
                 txtphone.Text = customer.Phone;
                 txtposition.Text = customer.Position;
                 txttax.Text = customer.Tax;
                 txttelPhone.Text = customer.TelPhone;
             }
             //客户编号不允许修改
             txtcustomerNo.Enabled = false;
         }
     }
 }
예제 #3
0
        /// <summary>
        /// 根据主键id查询客户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static CustomerManageMod GetcustomerByid(int id)
        {
            CustomerManageMod customer = new CustomerManageMod();
            string sqlcommandString = "select * from customer where customerId=" + id;

            try
            {
                SqlDataReader reader = SqlHelper.ExecuteReader(sqlcommandString);
                if (reader.Read())
                {
                    customer.CustomerId = Convert.ToInt32(reader["CustomerId"].ToString());
                    customer.BackMethod = reader["Phone"].ToString();
                    customer.CompanyName = reader["CompanyName"].ToString();
                    customer.Contacts = reader["Contacts"].ToString();
                    customer.CustomerNo = reader["CustomerNo"].ToString();
                    customer.Description = reader["Description"].ToString();
                    customer.Discount = reader["Discount"].ToString();
                    customer.InvoiceMethod = reader["InvoiceMethod"].ToString();
                    customer.IsFanben = Convert.ToInt32(reader["IsFanben"].ToString());
                    customer.Islock = Convert.ToInt32(reader["Islock"].ToString());
                    customer.IsShowPrice = Convert.ToInt32(reader["IsShowPrice"].ToString());
                    customer.ModifyPriceRecord = reader["ModifyPriceRecord"].ToString();
                    customer.Phone = reader["Phone"].ToString();
                    customer.Position = reader["Position"].ToString();
                    customer.Tax = reader["Tax"].ToString();
                    customer.TelPhone = reader["TelPhone"].ToString();
                    customer.IsFanben = Convert.ToInt32(reader["IsFanben"].ToString());
                    customer.CompanyAddress = reader["CompanyAddress"].ToString();
                    customer.OtherDangAn = reader["OtherDangAn"].ToString();
                    customer.ZhangHao = reader["ZhangHao"].ToString();
                    customer.ShuiHao = reader["ShuiHao"].ToString();
                    customer.BackMethod = reader["BackMethod"].ToString();
                    if (reader["isAddInfo"] != null && reader["isAddInfo"].ToString() != "")
                    {
                        customer.IsAddInfo = Convert.ToInt32(reader["isAddInfo"]);
                    }
                    reader.Close();
                    return customer;
                }
                else
                {
                    reader.Close();
                    return null;
                }

            }
            catch (Exception e)
            {
                throw e;
            }
        }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (true || Session["songhuodan"] == null)
            {

                string isFahuo = "1";// Session["songhuodan"].ToString();
                if (isFahuo == "1")
                {

                    Session["songhuodan"] = "1";
                    if (Request.QueryString["orderNum"] != null && Request.QueryString["orderNum"].ToString() != "")
                    {
                        orderNum = Request.QueryString["orderNum"].ToString();
                    }
                    if (Request.QueryString["proNum"] != null && Request.QueryString["proNum"].ToString() != "")
                    {
                        proNum = Request.QueryString["proNum"].ToString();
                    }
                    if (Request.QueryString["proType"] != null && Request.QueryString["proType"].ToString() != "")
                    {
                        proType = Request.QueryString["proType"].ToString();
                    }
                    if (Request.QueryString["customNum"] != null && Request.QueryString["customNum"].ToString() != "")
                    {
                        customNum = Request.QueryString["customNum"].ToString();
                        customerMod = new CustomerManageMod();
                        customerMod = CustomerManageBLL.GetcustomerByid(customNum);
                    }
                    string strOrderDetail = " and orderNum='" + orderNum + "'";
                    ProOrdersMOD proOrderMOD = ProOrdersBLL.GetModel(orderNum);
                    DataSet ds = ProOrdersDetailBLL.GetList(strOrderDetail);
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {

                        var countN = 0;
                        var countW = 0;
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            string proType = ds.Tables[0].Rows[i]["proType"].ToString();
                            ProductParamMOD paramMod = ProductParamBLL.GetmodByid(customNum, proType);
                            //    string proNum = ds.Tables[0].Rows[i]["proNum"].ToString();
                            object obj = SendDetailBLL.GetSendCountByProType(proType, orderNum);
                            if (obj != null)
                            {
                                proNum = obj.ToString();
                            }
                            if (proNum != "")
                            {
                                //根据产品型号和数量计算出外包装盒和内包装盒标签个数
                                int neiCount = 0;
                                int waiCount = 0;
                                productMod = ProductsBLL.GetModel(proType);
                                string nei = "";
                                string wai = "";

                                if (productMod != null)
                                {
                                    nei = productMod.NeiBZ;   //内包装盒的产品数
                                    wai = productMod.waiBZ.ToString();  //外包装盒里面内包装盒个数

                                    if (productMod.NeiBZ == "0")
                                    {
                                        //htmlStr += productMod.productName+ "内包装盒的产品数为0,系统无法计算内包装盒数量,请重新设置该产品内包装盒的产品数!";
                                        continue;
                                    }
                                    if (productMod.waiBZ == 0)
                                    {
                                        //htmlStr += productMod.productName+"外包装盒里面内包装盒个数为0,系统无法计算外包装盒数量,请重新设置外包装盒里面内包装盒个数!";
                                        continue;
                                    }

                                    if (Convert.ToInt32(proNum) % Convert.ToInt32(nei) == 0)
                                    {
                                        neiCount = Convert.ToInt32(proNum) / Convert.ToInt32(nei);
                                    }
                                    else
                                    {
                                        neiCount = (Convert.ToInt32(proNum) / Convert.ToInt32(nei)) + 1;
                                    }

                                    if (neiCount % Convert.ToInt32(wai) == 0)
                                    {
                                        waiCount = neiCount / Convert.ToInt32(wai);
                                    }
                                    else
                                    {
                                        waiCount = (neiCount / Convert.ToInt32(wai)) + 1;
                                    }
                                }
                                //内包装标签
                                htmlStr += "<table cellpadding='0' cellspacing='0' align='center'><tr><td>";
                                //  htmlStr += "<table cellpadding='0' cellspacing='0' style='width: 300px; margin-top: 10px;' align='center'><tr><td colspan='2'>内包装盒标签</tr></td></table>";

                                var htmlStrN = "";
                                var htmlStrW = "";

                                for (int j = 0; j < neiCount; j++)
                                {
                                    int num = 0;
                                    if (j == neiCount - 1)
                                    {
                                        num = Convert.ToInt32(proNum) - (Convert.ToInt32(nei) * (neiCount - 1));
                                    }
                                    else
                                    {
                                        num = Convert.ToInt32(nei);
                                    }
                                    if (j % 2 == 0)
                                    {
                                        htmlStrN += "<td/><tr/><tr><td>";
                                    }
                                    else
                                    {
                                        htmlStrN += "<td/><td>";
                                    }
                                    htmlStrN += "<table cellpadding='0' cellspacing='0' style='width: 300px; margin-top: 10px;padding-left:10px;padding-right:10px; border: 1px solid #000;margin-right:10px;' align='center'>";
                                    htmlStrN += "<tr><td colspan='2' align='center'>内包装盒标签</td></tr>";
                                    if (customerMod != null)
                                    {
                                        htmlStrN += "<tr><td style='width:120px;'>客户名称:<br />Customer name</td><td style='font-size:12px;'>" + customerMod.CompanyName + "</td></tr>";
                                    }
                                    else
                                    {
                                        htmlStrN += "<tr><td style='width:120px;'>客户名称:<br />Customer name</td><td></td></tr>";
                                    }
                                    htmlStrN += " <tr><td>型号:<br />Model number </td><td>" + proType + "</td></tr>";
                                    htmlStrN += "<tr><td>规格参数:<br />Parameters </td><td>" + productMod.bian + "</td></tr>";
                                    htmlStrN += " <tr><td>数    量:<br /> Quantity</td><td>" + num + "</td></tr>";
                                    htmlStrN += "<tr><td>封 装 日 期:<br />Packaging date</td><td>" + DateTime.Now.ToShortDateString() + "</td></tr>";
                                    htmlStrN += "</table>";

                                    countN++;
                                    if (countN % 8 == 0)
                                    {
                                        htmlStrN += "<div style='page-break-after:always;'>分页</div>";
                                    }
                                }
                                //  htmlStr += "<table cellpadding='0' cellspacing='0' style='width: 300px; margin-top: 10px;' align='center'><tr><td colspan='2'>外包装盒标签</tr></td></table>";
                                //外包装标签
                                // htmlStr += "<div style='clear:both;'><div/>";

                                for (int k = 0; k < waiCount; k++)
                                {
                                    string waiNUM = "";
                                    if (k == waiCount - 1)
                                    {
                                        // waiNUM = neiCount - (Convert.ToInt32(wai) * (waiCount - 1));   //剩余内包装盒

                                        waiNUM = neiCount - (Convert.ToInt32(wai) * (waiCount - 1)) + "盒(" + (Convert.ToInt32(proNum) - (Convert.ToInt32(wai) * (waiCount - 1) * Convert.ToInt32(nei))) + "PCS)";
                                    }
                                    else
                                    {
                                        waiNUM = Convert.ToInt32(wai) + "盒(" + (Convert.ToInt32(wai) * Convert.ToInt32(nei)) + "PCS)";  //如果是整除 数量为内包装盒个数
                                    }
                                    if (k % 2 == 0)
                                    {
                                        htmlStrW += "<td/><tr/><tr><td>";
                                    }
                                    else
                                    {
                                        htmlStrW += "<td/><td>";
                                    }
                                    htmlStrW += "<table cellpadding='0' cellspacing='0' style='width: 300px;padding-left:10px;padding-right:10px; margin-top: 10px; border: 1px solid #000; margin-right:10px;' align='center'>";
                                    htmlStrW += "<tr><td colspan='2' align='center'>外包装盒标签</td></tr>";
                                    if (customerMod != null)
                                    {
                                        htmlStrW += "<tr><td style='width:140px;'>客户名称:<br />Customer name</td><td style='font-size:12px;'>" + customerMod.CompanyName + "</td></tr>";
                                    }
                                    else
                                    {
                                        htmlStrW += "<tr><td style='width:140px;'>客户名称:<br />Customer name</td><td></td></tr>";
                                    }
                                    htmlStrW += " <tr><td>型号:<br />Model number </td><td>" + proType + "</td></tr>";
                                    htmlStrW += "<tr><td>规格参数:<br />Parameters </td><td>" + productMod.bian + "</td></tr>";
                                    htmlStrW += " <tr><td>数    量:<br /> Quantity</td><td>" + waiNUM + "</td></tr>";
                                    htmlStrW += "<tr><td>合同编号:<br /> Contract No.</td><td>" + proOrderMOD.heTongNum + "</td></tr>";
                                    if (paramMod != null)
                                    {
                                        htmlStrW += "<tr> <td>物料编号:<br />Material Code</td><td><input style='border:none;' value='" + paramMod.Wuliaobian + "'></input></td></tr>";
                                    }
                                    else
                                    {
                                        htmlStrW += "<tr> <td>物料编号:<br />Material Code</td><td><input style='border:none;'></input></td></tr>";
                                    }
                                    htmlStrW += "<tr><td>客户单号:<br />Purchase order No.</td><td>" + proOrderMOD.customOrderNum + "</td></tr>";
                                    htmlStrW += "<tr><td>供应商名称:<br />Vendor Company</td><td>北京霍远科技</td></tr>";
                                    htmlStrW += "<tr><td>件      数:<br />Number of packages</td><td>" + waiCount + "-" + (k + 1) + "</td></tr>";
                                    htmlStrW += "</table>";
                                    countW++;
                                    if (countW % 4 == 0)
                                    {
                                        htmlStrW += "<div style='page-break-after:always;'>分页</div>";
                                    }
                                }
                                htmlStr += htmlStrN;
                                htmlStr += "<div style='page-break-after:always;'>分页</div>";
                                htmlStr += htmlStrW;

                                htmlStr += "</table>";
                            }
                        }
                    }
                }
            }
        }
    }
예제 #5
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void rpt_userinfo_ItemCommand(object sender, RepeaterCommandEventArgs e)
 {
     int id = Convert.ToInt32(e.CommandArgument);
     if (e.CommandName == "del")
     {
         int num = CustomerManageBLL.Delete(id.ToString());
         if (num > 0)
         {
             ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "alert('删除成功');DetailsPageControl.ReflushList();", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "alert('删除失败');DetailsPageControl.ReflushList();", true);
         }
     }
     else if (e.CommandName == "dongjie")
     {
         CustomerManageMod MOD = new CustomerManageMod();
         MOD = CustomerManageBLL.GetcustomerByid(id);
         switch (MOD.Islock)
         {
             case 1:
                 MOD.Islock = 0;
                 break;
             case 0:
                 MOD.Islock = 1;
                 break;
         }
         int num = CustomerManageBLL.Updatecustomer(MOD);
         if (num > 0)
         {
             ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "alert('冻结/解冻成功');DetailsPageControl.ReflushList();", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "alert('冻结/解冻失败');DetailsPageControl.ReflushList();", true);
         }
     }
     LoadDataBind(strWhere);
 }
예제 #6
0
 /// <summary>
 /// 更新客户
 /// </summary>
 /// <param name="dtocustomerList">客户数据对象</param>
 /// <returns></returns>
 public static int Updatecustomer(CustomerManageMod customer)
 {
     return CustomerManageDAO.Updatecustomer(customer);
 }
예제 #7
0
 /// <summary>
 /// 添加客户
 /// </summary>
 /// <param name="dtocustomerList">客户对象</param>
 /// <returns></returns>
 public static int Insertcustomer(CustomerManageMod customer)
 {
     return CustomerManageDAO.Insertcustomer(customer);
 }
예제 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "")
            {
                string orderNum = Request.QueryString["id"].ToString();
                int id;
                if (Int32.TryParse(Request.QueryString["id"], out id))
                {
                    var db=new Web.Model.OrderPrintEntities();
                    orderNum = db.proOrders.Where(r => r.orderId == id).FirstOrDefault().orderNum;
                }

                //加载订单基本信息
                orderMod = ProOrdersBLL.GetModel(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;
                    //txtshuChuXianchang.Text = orderMod.ShuChuXianchang;
                    //txtshuRuXianchang.Text = orderMod.ShuRuXianchang;
                    //txtYijiekuanMoney.Text = orderMod.YijiekuanMoney.ToString();
                    //txtYikaipiaoMoney.Text = orderMod.YikaipiaoMoney.ToString();

                    var db = new Web.Model.OrderPrintEntities();
                    var intorderDetailId = id;
                    var gt_order = db.proOrders.FirstOrDefault(r => r.orderId == orderMod.orderId);
                    if (!string.IsNullOrEmpty(gt_order.发货状态))
                    {
                        rbl发货状态.SelectedValue = gt_order.发货状态;
                    }

                }
                //加载订单产品
                string strWhere = " and orderNum='" + orderNum + "'";
                DataSet ds = ProOrdersDetailBLL.GetList(strWhere);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    rptYongpin.DataSource = ds;
                    rptYongpin.DataBind();
                    txtTRLastIndex.Value = ds.Tables[0].Rows.Count.ToString();
                }
                else
                {
                    txtTRLastIndex.Value = "0";
                }
                //查看客户是否客户提供合同范本,如客户提供,打印合同按钮隐藏
                customer = CustomerManageBLL.GetcustomerByid(orderMod.customNum);
                if (customer != null)
                {
                    if (customer.IsFanben == 0)
                    {
                        tishi.InnerText = "本客户自己提供合同模板,请使用签订客户合同";
                        IBtn_Print.Visible = false;
                    }
                    else
                    {
                        IBtn_Print.Visible = true;
                    }
                }
                else
                {
                    IBtn_Print.Visible = true;
                }
                //订单号、客户编号不允许修改
                txtorderNum.Enabled = false;
                txtcustomNum.Enabled = false;
            }
        }
    }
예제 #9
0
    /// <summary>
    /// 添加
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Save_Click(object sender, ImageClickEventArgs e)
    {
        int num = 0;

        if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
        {
            int id = Convert.ToInt32(Request.QueryString["id"]);
            customer = CustomerManageBLL.GetcustomerByid(id);
            customer.BackMethod = txtbackMethod.Text.Trim();
            customer.CompanyAddress = txtcompanyAddress.Text.Trim();
            customer.CompanyName = txtcompanyName.Text.Trim();
            customer.Contacts = txtcontacts.Text.Trim();
            customer.Description = txtdescription.Text.Trim();

            customer.Discount = txtdiscount.Text.Trim();

            customer.InvoiceMethod = txtInvoiceMethod.Text.Trim();
            customer.IsFanben = rdoIsFanbenYes.Checked ? 0 : 1;
            customer.IsShowPrice = rdoIsShowPriceYes.Checked ? 0 : 1;
            customer.ModifyPriceRecord = txtmodifyPriceRecord.Text.Trim();
            customer.OtherDangAn = txtotherDangAn.Text.Trim();
            customer.Phone = txtphone.Text.Trim();
            customer.Position = txtposition.Text.Trim();
            customer.Tax = txttax.Text.Trim();
            customer.TelPhone = txttelPhone.Text.Trim();
            customer.ShuiHao = txtShuiHao.Text.Trim();
            customer.ZhangHao = txtZhangHao.Text.Trim();
            if (rdoIsAdd.Checked == true)
            {
                customer.IsAddInfo = 1;
            }
            else
            {
                customer.IsAddInfo = 0;
            }
            num = CustomerManageBLL.Updatecustomer(customer);
        }
        else
        {
            customer = new CustomerManageMod();
            customer.CustomerNo = txtcustomerNo.Text.Trim();
            customer.BackMethod = txtbackMethod.Text.Trim();
            customer.CompanyAddress = txtcompanyAddress.Text.Trim();
            customer.CompanyName = txtcompanyName.Text.Trim();
            customer.Contacts = txtcontacts.Text.Trim();
            customer.Description = txtdescription.Text.Trim();

            customer.Discount = txtdiscount.Text.Trim();

            customer.InvoiceMethod = txtInvoiceMethod.Text.Trim();
            customer.IsFanben = rdoIsFanbenYes.Checked ? 0 : 1;
            customer.IsShowPrice = rdoIsShowPriceYes.Checked ? 0 : 1;
            customer.ModifyPriceRecord = txtmodifyPriceRecord.Text.Trim();
            customer.OtherDangAn = txtotherDangAn.Text.Trim();
            customer.Phone = txtphone.Text.Trim();
            customer.Position = txtposition.Text.Trim();
            customer.Tax = txttax.Text.Trim();
            customer.TelPhone = txttelPhone.Text.Trim();
            customer.ShuiHao = txtShuiHao.Text.Trim();
            customer.ZhangHao = txtZhangHao.Text.Trim();
            if (rdoIsAdd.Checked == true)
            {
                customer.IsAddInfo = 1;
            }
            else
            {
                customer.IsAddInfo = 0;
            }
            num = CustomerManageBLL.Insertcustomer(customer);
        }
        if (num > 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "DetailsPageControl.CloseBox();alert('提交成功');DetailsPageControl.ReflushList('CustomerManage/CustomerManage.aspx');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "ListArea", "alert('提交失败');", true);
        }
    }
예제 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["orderNum"] != null && Request.QueryString["orderNum"].ToString() != "")
            {
                orderNum = Request.QueryString["orderNum"].ToString();
            }
            if (Request.QueryString["customNum"] != null && Request.QueryString["customNum"].ToString() != "")
            {
                customNum = Request.QueryString["customNum"].ToString();
                customerMod = new CustomerManageMod();
                customerMod = CustomerManageBLL.GetcustomerByid(customNum);
            }
            string strOrderDetail = " and orderNum='" + orderNum + "'";
            ProOrdersMOD proOrderMOD = ProOrdersBLL.GetModel(orderNum);
            DataSet ds = ProOrdersDetailBLL.GetList(strOrderDetail);
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string proType = ds.Tables[0].Rows[i]["proType"].ToString();
                    string proNum = ds.Tables[0].Rows[i]["proNum"].ToString();

                    //根据产品型号和数量计算出外包装盒和内包装盒标签个数
                    int neiCount = 0;
                    int waiCount = 0;
                    productMod = ProductsBLL.GetModel(proType);
                    string nei = "";
                    string wai = "";
                    if (productMod != null)
                    {
                        nei = productMod.NeiBZ;
                        wai = productMod.waiBZ.ToString();
                        if (Convert.ToInt32(proNum) % Convert.ToInt32(nei) == 0)
                        {
                            neiCount = Convert.ToInt32(proNum) / Convert.ToInt32(nei);
                        }
                        else
                        {
                            neiCount = (Convert.ToInt32(proNum) / Convert.ToInt32(nei)) + 1;
                        }

                        if (neiCount % Convert.ToInt32(wai) == 0)
                        {
                            waiCount = neiCount / Convert.ToInt32(wai);
                        }
                        else
                        {
                            waiCount = (neiCount / Convert.ToInt32(wai)) + 1;
                        }
                    }
                    //内包装标签

                    //  htmlStr += "<table cellpadding='0' cellspacing='0' style='width: 300px; margin-top: 10px;' align='center'><tr><td colspan='2'>内包装盒标签</tr></td></table>";
                    for (int j = 0; j < neiCount; j++)
                    {
                        int num = 0;
                        if (Convert.ToInt32(proNum) % Convert.ToInt32(nei) == 0)
                        {
                            num = Convert.ToInt32(nei);
                        }
                        else
                        {
                            num = (Convert.ToInt32(proNum) % Convert.ToInt32(nei));
                        }

                        htmlStr += "<table cellpadding='0' cellspacing='0' style='width: 300px; margin-top: 10px; border: 1px solid #808080' align='center'>";
                        htmlStr += "<tr><td colspan='2' align='center'>内包装盒标签</td></tr>";
                        htmlStr += "<tr><td>客户名称:<br />Customer name</td><td>" + customerMod.CompanyName + "</td></tr>";
                        htmlStr += " <tr><td>型号:<br />Model number </td><td>" + proType + "</td></tr>";
                        htmlStr += "<tr><td>规格参数:<br />Parameters </td><td>" + productMod.bian + "</td></tr>";
                        htmlStr += " <tr><td>数    量:<br /> Quantity</td><td>" + num + "</td></tr>";
                        htmlStr += "<tr><td>封 装 日 期:<br />Packaging date</td><td>" + DateTime.Now.ToShortDateString() + "</td></tr>";
                        htmlStr += "</table>";
                    }
                    htmlStr += "<table cellpadding='0' cellspacing='0' style='width: 300px; margin-top: 10px;' align='center'><tr><td colspan='2'>外包装盒标签</tr></td></table>";
                    //外包装标签
                    for (int k = 0; k < waiCount; k++)
                    {
                        int num = 0;
                        if (neiCount % Convert.ToInt32(wai) == 0)
                        {
                            num = Convert.ToInt32(wai) * Convert.ToInt32(nei);  //如果是整除 产品数量为内包装个数*每个内包装里的产品数

                        }
                        else
                        {
                            num = (neiCount % Convert.ToInt32(wai)) * Convert.ToInt32(nei);  //如果不整除 产品数量为外包装盒和内包装盒取余*每个内包装盒里的产品数
                        }
                        htmlStr += "<table cellpadding='0' cellspacing='0' style='width: 300px; margin-top: 10px; border: 1px solid #808080' align='center'>";
                        htmlStr += "<tr><td colspan='2' align='center'>外包装盒标签</td></tr>";
                        htmlStr += "<tr><td>客户名称:<br />Customer name</td><td>" + customerMod.CompanyName + "</td></tr>";
                        htmlStr += " <tr><td>型号:<br />Model number </td><td>" + proType + "</td></tr>";
                        htmlStr += "<tr><td>规格参数:<br />Parameters </td><td>" + productMod.bian + "</td></tr>";
                        htmlStr += " <tr><td>数    量:<br /> Quantity</td><td>" + num + "</td></tr>";
                        htmlStr += "<tr><td>合同编号:<br /> Contract No.</td><td>" + proOrderMOD.heTongNum + "</td></tr>";
                        htmlStr += "<tr> <td>物料编号:<br />Material Code</td><td>" + proOrderMOD.customWLBH + "</td></tr>";
                        htmlStr += "<tr><td>客户单号:<br />Purchase order No.</td><td>" + proOrderMOD.customOrderNum + "</td></tr>";
                        htmlStr += "<tr><td>供应商名称:<br />Vendor Company</td><td>北京霍远科技</td></tr>";
                        htmlStr += "<tr><td>件      数:<br />Number of packages</td><td>" + waiCount + "</td></tr>";
                        htmlStr += "</table>";
                    }
                }
            }
        }
    }
예제 #11
0
        /// <summary>
        /// 更新客户
        /// </summary>
        /// <param name="dtocustomerList">客户数据对象</param>
        /// <returns></returns>
        public static int Updatecustomer(CustomerManageMod customer)
        {
            string sqlCommandString = "Update customer Set customerNo=@customerNo,companyName=@companyName,contacts=@contacts,position=@position,phone=@phone,telPhone=@telPhone,tax=@tax,discount=@discount,InvoiceMethod=@InvoiceMethod,backMethod=@backMethod,isFanben=@isFanben,CompanyAddress=@CompanyAddress,OtherDangAn=@OtherDangAn,modifyPriceRecord=@modifyPriceRecord,description=@description,isShowPrice=@isShowPrice,islock=@islock,ZhangHao=@ZhangHao,ShuiHao=@ShuiHao,isAddInfo=@isAddInfo Where customerId=@customerId";
            SqlParameter[] arParams = new SqlParameter[21];

            arParams[0] = new SqlParameter("@customerNo", customer.CustomerNo);
            arParams[1] = new SqlParameter("@companyName", customer.CompanyName);
            arParams[2] = new SqlParameter("@contacts", customer.Contacts);
            arParams[3] = new SqlParameter("@position", customer.Position);
            arParams[4] = new SqlParameter("@phone", customer.Phone);
            arParams[5] = new SqlParameter("@telPhone", customer.TelPhone);
            arParams[6] = new SqlParameter("@tax", customer.Tax);
            arParams[7] = new SqlParameter("@discount", customer.Discount);
            arParams[8] = new SqlParameter("@InvoiceMethod", customer.InvoiceMethod);
            arParams[9] = new SqlParameter("@backMethod", customer.BackMethod);
            arParams[10] = new SqlParameter("@isFanben", customer.IsFanben);
            arParams[11] = new SqlParameter("@CompanyAddress", customer.CompanyAddress);
            arParams[12] = new SqlParameter("@OtherDangAn", customer.OtherDangAn);
            arParams[13] = new SqlParameter("@modifyPriceRecord", customer.ModifyPriceRecord);
            arParams[14] = new SqlParameter("@description", customer.Description);
            arParams[15] = new SqlParameter("@isShowPrice", customer.IsShowPrice);
            arParams[16] = new SqlParameter("@islock", customer.Islock);
            arParams[17] = new SqlParameter("@customerId", customer.CustomerId);
            arParams[18] = new SqlParameter("@ZhangHao", customer.ZhangHao);
            arParams[19] = new SqlParameter("@ShuiHao", customer.ShuiHao);
            arParams[20] = new SqlParameter("@isAddInfo",customer.IsAddInfo);
            return SqlHelper.ExecuteNonQuery(CommandType.Text, sqlCommandString, arParams);
        }