コード例 #1
0
        public string AnalysePrintData(string type, int status, IList <POItemInfo> itemNodes)
        {
            string     pageSize = "";
            string     message  = "";
            HttpCookie cookie   = Request.Cookies.Get("IQCPMPageSize");

            if (type == "RKBS")
            {
                if (itemNodes.Count > 0)
                {
                    //int count = itemNodes.ToList().FindIndex(p => string.IsNullOrEmpty(p.Material));
                    //if (count != -1)
                    //{
                    //    return "采购订单" + itemNodes[count].PONumber + "/" + itemNodes[count].Number + "没有物料号无法查询入库标识";
                    //}
                    Session["RKBS_PONumber"] = itemNodes[0].PONumber;
                    Session["RKBS_Number"]   = itemNodes[0].Number;

                    if (itemNodes[0].Vendor == null)
                    {
                        AccountInfo account = (AccountInfo)Session["Account"];
                        itemNodes[0].Vendor = account.ID;
                    }
                    Session["RKBS_Vendor"]              = itemNodes[0].Vendor;
                    Session["RKBS_NeedQty"]             = itemNodes[0].DelivQty;
                    Session["RKBS_PcsInCtn"]            = itemNodes[0].PcsInCtn;
                    Session["RKBS_PcsInPal"]            = itemNodes[0].PcsInPal;
                    Session["RKBS_Material"]            = itemNodes[0].Material;
                    Session["RKBS_MaterialDescription"] = itemNodes[0].MaterialDescription;
                }
            }
            else if (type == "RKBSZH")
            {
                if (itemNodes.Count > 0)
                {
                    IList <ZSL_BCS104> PLIST = new List <ZSL_BCS104>();
                    foreach (POItemInfo pi in itemNodes)
                    {
                        ZSL_BCS104 node = new ZSL_BCS104();
                        node.Ebeln = pi.PONumber;
                        node.Ebelp = pi.Number.ToString().PadLeft(5, '0');
                        PLIST.Add(node);
                    }

                    if (itemNodes[0].Vendor == null)
                    {
                        AccountInfo account = (AccountInfo)Session["Account"];
                        itemNodes[0].Vendor = account.ID;
                    }
                    int    GLTS = 0;
                    string DYFS = "V";
                    string USER = itemNodes[0].Vendor;
                    string MODE = "Y";
                    int    FS   = 1;

                    message = models.PurchaseOrder.GenerateStorageIdentificationZH(GLTS, DYFS, USER, MODE, FS, PLIST).Trim();
                    if (message == "")
                    {
                        Session["RKBSZH_POLIST"] = models.PurchaseOrder.GetStorageIdentificationZHList(GLTS, DYFS, USER, MODE, FS, PLIST);
                    }
                }
            }
            else if (type == "RKBSGCL")
            {
                List <ZSL_BCS303_CT> nodes = new List <ZSL_BCS303_CT>();
                for (int i = 0; i < itemNodes.Count; i++)
                {
                    ZSL_BCS303_CT node = new ZSL_BCS303_CT();
                    node.Ebeln = itemNodes[i].PONumber.ToString();
                    node.Ebelp = itemNodes[i].Number.ToString();
                    nodes.Add(node);
                }


                ZMMFUN_PURBS_READ res = models.PurchaseOrder.ZMMFUN_PURBS_READ(nodes);
                if (res.MES_RETURN.TYPE.Equals("S"))
                {
                    Session["PRINTRKBS_GCL"] = models.PurchaseOrder.ZMMFUN_PURBS_READ(nodes);
                }
                else
                {
                    message = res.MES_RETURN.MESSAGE;
                }

                //Session["PRINTRKBS_GCL"] = res;
            }
            else
            {
                if (cookie != null)
                {
                    pageSize = cookie.Value;
                }
                if (itemNodes != null)
                {
                    //List<POInfoClassify> a = models.PurchaseOrder.AnalysePrintData(type, status, pageSize, itemNodes);
                    //object b = a[0].Children[0].Items[0].CustomText;
                    if (Session["Account"] != null && (type == "IQCPM" || type == "DeliveryF"))
                    {
                        AccountInfo account = (AccountInfo)Session["Account"];
                        foreach (var item in itemNodes)
                        {
                            if (string.IsNullOrEmpty(item.Vendor))
                            {
                                item.Vendor = account.ID;
                            }
                            if (string.IsNullOrEmpty(item.LNAME))
                            {
                                item.LNAME = account.Name;
                            }
                        }
                    }
                    Session["PrintData"] = models.PurchaseOrder.AnalysePrintData(type, status, pageSize, itemNodes, Session["crmtoken"] == null ? "" : Session["crmtoken"].ToString());
                }
                else
                {
                    message = "数据异常!";
                }
            }

            return(message);
        }
コード例 #2
0
ファイル: MES_WLKCBS.cs プロジェクト: shenqingying/CodeTest
 public ZBCFUN_PURBS_READ GET_WLPZ(ZSL_BCS303_CT IS_PURCT, string ptoken)
 {
     return(client.GET_WLPZ(IS_PURCT, ptoken));
 }
コード例 #3
0
        private void cxbutton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(slrqfromdateTimePicker.Text.Trim()))
            {
                //ShowMeg("输入开始时间不能为空");
                ShowMeg(q(Msg_Type.msgslkssjnoempty));
                return;
            }
            if (string.IsNullOrEmpty(slrqtodateTimePicker.Text.Trim()))
            {
                //ShowMeg("输入结束时间不能为空");
                ShowMeg(q(Msg_Type.msgsljssjnoempty));
                return;
            }
            TimeSpan slrqtspan = Convert.ToDateTime(slrqfromdateTimePicker.Text.Trim()) - Convert.ToDateTime(slrqtodateTimePicker.Text.Trim());

            if (slrqtspan.Minutes > 0)
            {
                //ShowMeg("输入开始日期不能大于输入结束日期");
                ShowMeg(q(Msg_Type.msgslksqtjs));
                return;
            }

            ZSL_BCS303_CT zModel = new ZSL_BCS303_CT();

            if (!string.IsNullOrEmpty(gzrqfromtextBox.Text.Trim()))
            {
                if (judge.IsDate(gzrqfromtextBox.Text.Trim()) == false)
                {
                    //ShowMeg("过账开始日期不是正确的日期格式");
                    ShowMeg(q(Msg_Type.msggzksformat));
                    return;
                }
                ;
                zModel.BUDAT_ST = Convert.ToDateTime(gzrqfromtextBox.Text.Trim()).ToString("yyyyMMdd");
            }
            if (!string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()))
            {
                if (judge.IsDate(gzrqtotextBox.Text.Trim()) == false)
                {
                    //ShowMeg("过账结束日期不是正确的日期格式");
                    ShowMeg(q(Msg_Type.msggzjsformat));
                    return;
                }
                zModel.BUDAT_ED = Convert.ToDateTime(gzrqtotextBox.Text.Trim()).ToString("yyyyMMdd");
            }
            if (!string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()) && !string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()))
            {
                TimeSpan tspan = Convert.ToDateTime(gzrqtotextBox.Text.Trim()) - Convert.ToDateTime(gzrqfromtextBox.Text.Trim());
                if (tspan.Days < 0)
                {
                    //ShowMeg("过账开始日期不能大于过账结束日期");
                    ShowMeg(q(Msg_Type.msggzksqtjs));
                    return;
                }
            }
            //if (!string.IsNullOrEmpty(gzrqfromtextBox.Text.Trim()))
            //{
            //    if (judge.IsDate(gzrqfromtextBox.Text.Trim()) == false)
            //    {
            //        ShowMeg("过账开始日期不是正确的日期格式");
            //        return;
            //    };
            //    zModel.BUDAT_ST = Convert.ToDateTime(gzrqfromtextBox.Text.Trim()).ToString("yyyyMMdd");
            //}
            //if (!string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()))
            //{
            //    if (judge.IsDate(gzrqtotextBox.Text.Trim()) == false)
            //    {
            //        ShowMeg("过账结束日期不是正确的日期格式");
            //        return;
            //    }
            //    zModel.BUDAT_ED = Convert.ToDateTime(gzrqtotextBox.Text.Trim()).ToString("yyyyMMdd");
            //}

            //if (!Convert.ToDateTime(gzrqfromdateTimePicker.Text.Trim()).ToString("yyyy-MM-dd").Equals("1900-01-01"))
            //{
            //    zModel.BUDAT_ST = Convert.ToDateTime(gzrqfromdateTimePicker.Text.Trim()).ToString("yyyyMMdd");
            //}
            //if (!Convert.ToDateTime(gzrqtodateTimePicker.Text.Trim()).ToString("yyyy-MM-dd").Equals("9998-12-31"))
            //{
            //    zModel.BUDAT_ED = Convert.ToDateTime(gzrqtodateTimePicker.Text.Trim()).ToString("yyyyMMdd");
            //}
            if (!string.IsNullOrEmpty(wlpztextBox.Text.Trim()))
            {
                if (judge.IsNumber(wlpztextBox.Text.Trim()) && wlpztextBox.Text.Trim().Length == 10)
                {
                    zModel.MBLNR = wlpztextBox.Text.Trim();
                }
                else
                {
                    ShowMeg(q(Msg_Type.msgwlpzlengthtendigital));//"物料凭证是10位数的数字"
                    return;
                }
            }
            if (!string.IsNullOrEmpty(tmtextBox.Text.Trim()))
            {
                if (tmtextBox.Text.Length != 12)
                {
                    ShowMeg(q(Msg_Type.msgtmlengthtwelve));//"条码长度不正确,正确的条码长度是12位"
                    return;
                }
                else
                {
                    zModel.TM = tmtextBox.Text.Trim().ToUpper();
                }
            }
            if (!Convert.ToString(gccomboBox.SelectedValue).Equals("0"))
            {
                zModel.WERKS = Convert.ToString(gccomboBox.SelectedValue);
            }
            else
            {
                ShowMeg(q(Msg_Type.msggcnoempty));//"工厂信息不能为空"
                return;
            }
            if (!string.IsNullOrEmpty(pctextBox.Text.Trim()))
            {
                zModel.CHARG = pctextBox.Text.Trim();
            }
            if (!string.IsNullOrEmpty(wlbmtextBox.Text.Trim()))
            {
                zModel.MATNR = wlbmtextBox.Text.Trim();
            }
            if (!string.IsNullOrEmpty(cgddtextBox.Text.Trim()))
            {
                zModel.EBELN = cgddtextBox.Text.Trim();
            }
            if (!string.IsNullOrEmpty(gystextBox.Text.Trim()))
            {
                zModel.LIFNR = gystextBox.Text.Trim();
            }

            //if (!string.IsNullOrEmpty(gzrqfromtextBox.Text.Trim()) && !string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()))
            //{
            //    if (Convert.ToDateTime(gzrqfromtextBox.Text.Trim()) > Convert.ToDateTime(gzrqtotextBox.Text.Trim()))
            //    {
            //        ShowMeg("过账开始日期不能大于结束日期");
            //        return;
            //    }
            //}


            zModel.ISNOTPRINT = wdycheckBox.Checked;
            zModel.CPUDT_ST   = Convert.ToDateTime(slrqfromdateTimePicker.Text).ToString("yyyyMMdd");
            zModel.CPUDT_ED   = Convert.ToDateTime(slrqtodateTimePicker.Text).ToString("yyyyMMdd");
            zModel.CPUTM_ST   = Convert.ToDateTime(slrqfromdateTimePicker.Text).ToString("HHmmss");
            zModel.CPUTM_ED   = Convert.ToDateTime(slrqtodateTimePicker.Text).ToString("HHmmss");
            zModel.STAFFID    = Convert.ToInt32(getUserInfo("staffid"));
            if (dbpzcheckBox.Checked)
            {
                zModel.DBBS = "Y";
                if (Convert.ToString(kcdfcomboBox.SelectedValue).Equals("0"))
                {
                    ShowMeg(q(Msg_Type.msgdbpzneedkcdf));//"调拨凭证必须输入库存地点"
                    return;
                }
            }
            else
            {
                zModel.DBBS = "";
            }
            if (!Convert.ToString(kcdfcomboBox.SelectedValue).Equals("0"))
            {
                zModel.LGORT = Convert.ToString(kcdfcomboBox.SelectedValue);
            }
            ZBCFUN_PURBS_READ res = ServicModel.MES_WLKCBS.GET_WLPZ(zModel, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.ET_PURBS.Length == 0)
                {
                    List = new List <ZSL_BCS303_BS>();
                    JLdataGridView.DataSource = List;
                    Type         type = JLdataGridView.GetType();
                    PropertyInfo pi   = type.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                    pi.SetValue(JLdataGridView, true, null);
                    ShowMeg(q(Msg_Type.msgnodata));//"未查询到数据"
                }
                else
                {
                    List = res.ET_PURBS.ToList();
                    //for (int i = 0; i < List.Count; i++)
                    //{
                    //    List[i].QSTH = "1";
                    //}
                    JLdataGridView.DataSource = res.ET_PURBS.ToList();
                    JLdataGridView.ClearSelection();

                    Type         type = JLdataGridView.GetType();
                    PropertyInfo pi   = type.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                    pi.SetValue(JLdataGridView, true, null);
                }
            }
            else
            {
                List = new List <ZSL_BCS303_BS>();
                JLdataGridView.DataSource = List;
                Type         type = JLdataGridView.GetType();
                PropertyInfo pi   = type.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                pi.SetValue(JLdataGridView, true, null);
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
コード例 #4
0
        private void cxbutton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(slrqfromdateTimePicker.Text.Trim()))
            {
                ShowMeg("输入开始时间不能为空");
                return;
            }
            if (string.IsNullOrEmpty(slrqtodateTimePicker.Text.Trim()))
            {
                ShowMeg("输入开始时间不能为空");
                return;
            }



            ZSL_BCS303_CT zModel = new ZSL_BCS303_CT();

            if (!string.IsNullOrEmpty(gzrqfromtextBox.Text.Trim()))
            {
                if (judge.IsDate(gzrqfromtextBox.Text.Trim()) == false)
                {
                    ShowMeg("过账开始日期不是正确的日期格式");
                    return;
                }
                ;
                zModel.BUDAT_ST = Convert.ToDateTime(gzrqfromtextBox.Text.Trim()).ToString("yyyyMMdd");
            }
            if (!string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()))
            {
                if (judge.IsDate(gzrqtotextBox.Text.Trim()) == false)
                {
                    ShowMeg("过账结束日期不是正确的日期格式");
                    return;
                }
                zModel.BUDAT_ED = Convert.ToDateTime(gzrqtotextBox.Text.Trim()).ToString("yyyyMMdd");
            }
            if (!string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()) && !string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()))
            {
                TimeSpan tspan = Convert.ToDateTime(gzrqtotextBox.Text.Trim()) - Convert.ToDateTime(gzrqfromtextBox.Text.Trim());
                if (tspan.Days < 0)
                {
                    ShowMeg("过账开始日期不能大于过账结束日期");
                    return;
                }
            }
            //if (!string.IsNullOrEmpty(gzrqfromtextBox.Text.Trim()))
            //{
            //    if (judge.IsDate(gzrqfromtextBox.Text.Trim()) == false)
            //    {
            //        ShowMeg("过账开始日期不是正确的日期格式");
            //        return;
            //    };
            //    zModel.BUDAT_ST = Convert.ToDateTime(gzrqfromtextBox.Text.Trim()).ToString("yyyyMMdd");
            //}
            //if (!string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()))
            //{
            //    if (judge.IsDate(gzrqtotextBox.Text.Trim()) == false)
            //    {
            //        ShowMeg("过账结束日期不是正确的日期格式");
            //        return;
            //    }
            //    zModel.BUDAT_ED = Convert.ToDateTime(gzrqtotextBox.Text.Trim()).ToString("yyyyMMdd");
            //}

            //if (!Convert.ToDateTime(gzrqfromdateTimePicker.Text.Trim()).ToString("yyyy-MM-dd").Equals("1900-01-01"))
            //{
            //    zModel.BUDAT_ST = Convert.ToDateTime(gzrqfromdateTimePicker.Text.Trim()).ToString("yyyyMMdd");
            //}
            //if (!Convert.ToDateTime(gzrqtodateTimePicker.Text.Trim()).ToString("yyyy-MM-dd").Equals("9998-12-31"))
            //{
            //    zModel.BUDAT_ED = Convert.ToDateTime(gzrqtodateTimePicker.Text.Trim()).ToString("yyyyMMdd");
            //}
            if (!string.IsNullOrEmpty(wlpztextBox.Text.Trim()))
            {
                zModel.MBLNR = wlpztextBox.Text.Trim();
            }
            if (!string.IsNullOrEmpty(tmtextBox.Text.Trim()))
            {
                if (tmtextBox.Text.Length != 12)
                {
                    ShowMeg("条码长度不正确,正确的条码长度是12位");
                    return;
                }
                else
                {
                    zModel.TM = tmtextBox.Text.Trim().ToUpper();
                }
            }
            if (!string.IsNullOrEmpty(pctextBox.Text.Trim()))
            {
                zModel.CHARG = pctextBox.Text.Trim();
            }
            if (!string.IsNullOrEmpty(wlbmtextBox.Text.Trim()))
            {
                zModel.MATNR = wlbmtextBox.Text.Trim();
            }
            if (!string.IsNullOrEmpty(cgddtextBox.Text.Trim()))
            {
                zModel.EBELN = cgddtextBox.Text.Trim();
            }
            if (!string.IsNullOrEmpty(gystextBox.Text.Trim()))
            {
                zModel.LIFNR = gystextBox.Text.Trim();
            }

            //if (!string.IsNullOrEmpty(gzrqfromtextBox.Text.Trim()) && !string.IsNullOrEmpty(gzrqtotextBox.Text.Trim()))
            //{
            //    if (Convert.ToDateTime(gzrqfromtextBox.Text.Trim()) > Convert.ToDateTime(gzrqtotextBox.Text.Trim()))
            //    {
            //        ShowMeg("过账开始日期不能大于结束日期");
            //        return;
            //    }
            //}



            zModel.WERKS = Convert.ToString(gccomboBox.SelectedValue);
            zModel.LGORT = Convert.ToString(kcdfcomboBox.SelectedValue);


            zModel.ISNOTPRINT = wdycheckBox.Checked;
            zModel.CPUDT_ST   = Convert.ToDateTime(slrqfromdateTimePicker.Text).ToString("yyyyMMdd");
            zModel.CPUDT_ED   = Convert.ToDateTime(slrqtodateTimePicker.Text).ToString("yyyyMMdd");
            zModel.CPUTM_ST   = Convert.ToDateTime(slrqfromdateTimePicker.Text).ToString("HHmmss");
            zModel.CPUTM_ED   = Convert.ToDateTime(slrqtodateTimePicker.Text).ToString("HHmmss");
            ZBCFUN_PURBS_READ res = ServicModel.MES_WLKCBS.GET_WLPZ(zModel, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.ET_PURBS.Length == 0)
                {
                    List = new List <ZSL_BCS303_BS>();
                    JLdataGridView.DataSource = List;
                    Type         type = JLdataGridView.GetType();
                    PropertyInfo pi   = type.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                    pi.SetValue(JLdataGridView, true, null);
                    ShowMeg("未查询到数据");
                }
                else
                {
                    List = res.ET_PURBS.ToList();
                    JLdataGridView.DataSource = res.ET_PURBS.ToList();
                    JLdataGridView.ClearSelection();

                    Type         type = JLdataGridView.GetType();
                    PropertyInfo pi   = type.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                    pi.SetValue(JLdataGridView, true, null);
                }
            }
            else
            {
                List = new List <ZSL_BCS303_BS>();
                JLdataGridView.DataSource = List;
                Type         type = JLdataGridView.GetType();
                PropertyInfo pi   = type.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                pi.SetValue(JLdataGridView, true, null);
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }