Esempio n. 1
0
        private void initComboBox()
        {
            //初始化品牌列表
            var list = _service.GetBrandList(Global.LoginUser);

            foreach (var item in list)
            {
                cbo品牌.Properties.Items.Add(item);

                string brandid = IniHelper.ReadString(Global.IniUrl, "CONFIG", "FBRANDID", "");
                if (item.FID == brandid)
                {
                    cbo品牌.SelectedItem = item;
                }

                comBrand.Properties.Items.Add(item);
                if (item.FID == brandid)
                {
                    comBrand.SelectedItem = item;
                }
            }

            //初始化单据状态选择
            cbo状态.Properties.Items.Add(new CodeValueClass("0", "全部"));
            cbo状态.Properties.Items.Add(new CodeValueClass("3", "审核通过"));
            cbo状态.Properties.Items.Add(new CodeValueClass("7", "采购确认"));
            cbo状态.Properties.Items.Add(new CodeValueClass("1", "草稿"));
            cbo状态.Properties.Items.Add(new CodeValueClass("2", "待审核"));
            cbo状态.Properties.Items.Add(new CodeValueClass("4", "审核不通过"));
            cbo状态.Properties.Items.Add(new CodeValueClass("6", "完成"));
            cbo状态.Properties.Items.Add(new CodeValueClass("5", "关闭"));
        }
Esempio n. 2
0
        private void initComboBox()
        {
            //初始化品牌列表
            var list = _service.GetBrandList(Global.LoginUser);

            foreach (var item in list)
            {
                cbo品牌.Properties.Items.Add(item);

                string brandid = IniHelper.ReadString(Global.IniUrl, "CONFIG", "FBRANDID", "");
                if (item.FID == brandid)
                {
                    cbo品牌.SelectedItem = item;
                }
            }

            //初始化单据状态选择
            var billTypes = Enum.GetValues(typeof(ICPOBILLStatus));


            foreach (var billType in billTypes)
            {
                cbo状态.Properties.Items.Add(billType);
            }

            cbo状态.SelectedItem = null;
        }
Esempio n. 3
0
        public FrmLogin()
        {
            InitializeComponent();

            SetClassLong(this.Handle, GCL_STYLE, GetClassLong(this.Handle, GCL_STYLE) | CS_DropSHADOW); //API函数加载,实现窗体边框阴影效果
            txtACC.Focus();
            txtACC.Text     = IniHelper.ReadString(Global.IniUrl, "CONFIG", "username", "");
            txtPAS.Text     = IniHelper.ReadString(Global.IniUrl, "CONFIG", "password", "");
            lblVerName.Text = IniHelper.ReadString(Global.IniUrl, "CONFIG", "VerName", "");
        }
Esempio n. 4
0
        static void Main()
        {
            Global.WcfUrl = IniHelper.ReadString(Global.IniUrl, "CONFIG", "URL", "");
            Global.WebUrl = IniHelper.ReadString(Global.IniUrl, "CONFIG", "Web", "");


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            Application.Run(new FrmLogin());
        }
Esempio n. 5
0
        private void initComboBox()
        {
            //初始化品牌列表
            var list = _service.GetBrandList(Global.LoginUser);

            foreach (var item in list)
            {
                cbo品牌.Properties.Items.Add(item);

                string brandid = IniHelper.ReadString(Global.IniUrl, "CONFIG", "FBRANDID", "");
                if (item.FID == brandid)
                {
                    cbo品牌.SelectedItem = item;
                }
            }
        }
        void setBrandCombox()
        {
            var list = _service.GetBrandList(Global.LoginUser);

            list = list.Where(p => p.FNAME.Contains("箭牌") || p.FNAME.Contains("法恩")).ToArray();
            string brandid = IniHelper.ReadString(Global.IniUrl, "CONFIG", "FBRANDID", "");

            comBrand.Properties.Items.AddRange(list);
            comBrand.SelectedIndex = 0;
            var selectBrand = list.SingleOrDefault(p => p.FID == brandid);

            if (selectBrand != null)
            {
                comBrand.SelectedItem = selectBrand;
            }
        }
Esempio n. 7
0
        public frm库存查询(int status = 3)
        {
            InitializeComponent();

            _service = new ApiService.APIServiceClient("BasicHttpBinding_IAPIService", Global.WcfUrl);
            //初始化品牌列表
            var list = _service.GetBrandList(Global.LoginUser);

            foreach (var item in list)
            {
                cbo品牌.Properties.Items.Add(item);

                string brandid = IniHelper.ReadString(Global.IniUrl, "CONFIG", "FBRANDID", "");
                if (item.FID == brandid)
                {
                    cbo品牌.SelectedItem = item;
                }
            }

            loadDrop();
        }
        private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
        {
            tumMessage = "";
            switch (optype)
            {
            case "0":
                try
                {
                    _dataSrouce = _service.GetDeliveryList(
                        Global.LoginUser,
                        brand,
                        xq == "全部" ? "" : xq,
                        "",
                        status,
                        car,
                        "",
                        account,
                        expresscompany,
                        txt厂家单号.Text,
                        txt发货计划单号.Text,
                        txt组柜单号.Text,
                        txt工程名称.Text,
                        startdate == "0001/01/01" ? "" : startdate,
                        enddate == "0001/01/01" ? "" : enddate,
                        !chkClose.Checked);
                }
                catch (Exception ee)
                {
                    tumMessage = ee.ToStr();
                }


                break;

            case "2":
                try
                {
                    FrmAuditDialog dialog = new FrmAuditDialog("审核", "请选择你要做的处理", "通过", "不通过");
                    DialogResult   result = dialog.ShowDialog();
                    if (result == DialogResult.Yes)
                    {
                        //调用发货计划审核接口
                        int res3 = _service.AuditDeliveryByIDs(ids_sh, 3, Global.LoginUser);
                        MsgHelper.ShowInformation("处理成功!");
                    }
                    else if (result == DialogResult.No)
                    {
                        //调用发货计划审核接口
                        int res2 = _service.AuditDeliveryByIDs(ids_sh, 4, Global.LoginUser);
                        MsgHelper.ShowInformation("处理成功!");
                    }

                    foreach (var model in _dataSrouce)
                    {
                        foreach (string id in list)
                        {
                            if (model.FID == id)
                            {
                                model.FCHECK = true;
                            }
                        }
                    }
                }
                catch (Exception ee)
                {
                    tumMessage = ee.ToStr();
                }
                break;

            case "3":
                //调用发货计划删除接口
                try
                {
                    int res = _service.AuditAntiDeliveryByIDs(ids_sh);
                    if (res > 0)
                    {
                        MsgHelper.ShowInformation("处理成功!");
                    }
                }
                catch (Exception ee)
                {
                    tumMessage = ee.ToStr();
                }
                break;

            case "4":
                //调用发货计划接口
                try
                {
                    fid_tb.Clear();
                    for (int k = 0; k < listModels.Count; k++)
                    {
                        V_ICSEOUTBILLMODEL           rowData = listModels[k];
                        List <MApiModel.api12.Datum> LItem   = new List <MApiModel.api12.Datum>();
                        var entryList = _service.GetDeliveryEntryList(rowData.FID);

                        foreach (var sub22 in entryList)
                        {
                            v_thdModel v = _service.getTHD(sub22.thdbm);
                            sub22.khmc = v.khmc;
                            sub22.khhm = v.khhm;
                            sub22.gg   = v.cpgg;
                            sub22.xh   = v.cpxh;
                            sub22.pz   = v.cppz;
                            sub22.dw   = v.dw;
                            sub22.dj   = v.dj;
                            sub22.pz   = v.cppz;
                            sub22.xh   = v.cpxh;
                            sub22.gg   = v.cpgg;
                            sub22.khhm = v.khhm;
                            sub22.khmc = v.khmc;
                            sub22.cpdj = v.cpdj;
                            sub22.pzhm = v.pzhm;
                            sub22.kdrq = v.rq.ToString("yyyy-MM-dd");
                            sub22.cpcm = v.cpcm;
                            sub22.cpsh = v.cpsh;
                        }

                        string comid = "2";

                        foreach (var subEntry in entryList)
                        {
                            v_thdModel vTHD = _service.getTHD(subEntry.thdbm);
                            comid = vTHD.DB;

                            //list.Add(rowData.FID);
                            MApiModel.api12.Datum subItem = new MApiModel.api12.Datum();
                            subItem.pzhm = rowData.FBILLNO.Replace("DP", "");
                            subItem.rq   = rowData.FBILLDATE.Year + "/" + (rowData.FBILLDATE.Month < 10 ? "0" + rowData.FBILLDATE.Month.ToStr() : rowData.FBILLDATE.Month.ToStr()) + "/" + (rowData.FBILLDATE.Day < 10 ? "0" + rowData.FBILLDATE.Day.ToStr() : rowData.FBILLDATE.Day.ToStr());
                            subItem.khhm = vTHD.khhm;
                            subItem.khmc = vTHD.khmc;

                            subItem.pzlb = "";
                            subItem.cplb = 0;
                            //subItem.pjhm = string.IsNullOrEmpty(rowData.thdbm)?"":rowData.thdbm;
                            subItem.zdr  = "300384";
                            subItem.pjhm = string.IsNullOrEmpty(vTHD.pzhm) ? "" : vTHD.pzhm;

                            // string[] strArr = pro.FSRCCODE.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);
                            //产品品种

                            subItem.cppz = vTHD.cppz;
                            //产品规格
                            subItem.cpgg = vTHD.cpgg;
                            //产品型号
                            subItem.cpxh = vTHD.cpxh;


                            subItem.cpdj    = vTHD.cpdj;
                            subItem.cpsh    = string.IsNullOrEmpty(vTHD.cpsh) ? "" : vTHD.cpsh; // string.IsNullOrEmpty(subEntry.FCOLORNO)?"":subEntry.FCOLORNO;
                            subItem.cpcm    = string.IsNullOrEmpty(vTHD.cpcm) ? "" : vTHD.cpcm; // string.IsNullOrEmpty(subEntry.FSTOCKNUMBER)?0:int.Parse(subEntry.FSTOCKNUMBER);
                            subItem.package = vTHD.tpackage;
                            subItem.dw      = vTHD.dw;
                            subItem.ks      = int.Parse(vTHD.ks);
                            subItem.sl      = (int)subEntry.FCOMMITQTY;
                            subItem.bz      = string.IsNullOrEmpty(subEntry.FREMARK) ? "" : subEntry.FREMARK;
                            subItem.gg      = vTHD.gg == null ? "" : vTHD.gg;

                            try
                            {
                                decimal dGGS = subItem.ks * subItem.sl * decimal.Parse(vTHD.gg);
                                subItem.ggs = dGGS.ToStr();
                            }
                            catch
                            {
                                subItem.ggs = vTHD.GGS == null ? "" : vTHD.GGS;
                            }


                            subItem.pjhm1 = "";
                            //
                            //subItem.package = vTHD.tpackage;
                            subItem.pjhm2    = "";
                            subItem.telphone = string.IsNullOrEmpty(rowData.FDELIVERERTEL) ? "123456789" : rowData.FDELIVERERTEL;

                            string strCarno = "";
                            strCarno += string.IsNullOrEmpty(rowData.FCARNUMBER) ? "" : rowData.FCARNUMBER;
                            strCarno += string.IsNullOrEmpty(rowData.FDELIVERER) ? "" : " 司机:" + rowData.FDELIVERER;
                            strCarno += string.IsNullOrEmpty(rowData.FDELIVERERTEL) ? "" : " 电话:" + rowData.FDELIVERERTEL;

                            decimal dLength = decimal.Parse(IniHelper.ReadString(Global.IniUrl, "CONFIG", "cph", "40"));

                            if (strCarno.Length > (int)dLength)
                            {
                                strCarno = strCarno.Substring(0, (int)dLength - 1);
                            }

                            subItem.carno = strCarno.Trim().Replace("  ", "");


                            subItem.jsdz     = string.IsNullOrEmpty(rowData.FRECEIVER_DISTRICT_NAME) ? "广东省" : rowData.FRECEIVER_DISTRICT_NAME;
                            subItem.jsr      = subItem.telphone;
                            subItem.pjhm3    = rowData.FBILLNO.Replace("DP", "");
                            subItem.ysfs     = string.IsNullOrEmpty(rowData.FDELIVERY_METHODNAME) ? "" : rowData.FDELIVERY_METHODNAME;
                            subItem.jsfs     = "";
                            subItem.Province = string.IsNullOrEmpty(rowData.FRECEIVER_PROVINCE_NAME) ? "广东省" : rowData.FRECEIVER_PROVINCE_NAME;
                            subItem.City     = string.IsNullOrEmpty(rowData.FRECEIVER_CITY_NAME) ? "佛山市" : rowData.FRECEIVER_CITY_NAME;
                            subItem.Region   = "南海区";
                            subItem.bz       = string.IsNullOrEmpty(rowData.FREMARK) ? "" : rowData.FREMARK;
                            LItem.Add(subItem);
                        }

                        if (LItem.Count > 0)
                        {
                            MApiModel.api12.Rootobject getapi6 = new MApiModel.api12.Rootobject();
                            getapi6.data  = LItem.ToArray();
                            getapi6.comid = int.Parse(comid);
                            string fid = rowData.FID;

                            if (!fid_tb.ContainsKey(fid) && fid != "")
                            {
                                fid_tb.Add(fid, getapi6);
                            }
                        }
                    }


                    List <string> listFalse = new List <string>();
                    int           iIndex    = 0;
                    List <string> listKeys  = new List <string>();
                    foreach (var sub333 in fid_tb)
                    {
                        listKeys.Add(sub333.Key);
                    }
                    foreach (string sub33 in listKeys)
                    {
                        if (!fid_tb.ContainsKey(sub33))
                        {
                            continue;
                        }
                        iIndex++;
                        string k = sub33;

                        MApiModel.api12.Rootobject v = fid_tb[sub33];
                        var    jsonData = JsonHelper.ToJson(v);
                        string res1     = _service.SyncDeliveryByIDsMN(jsonData, k);
                        if (res1 == "1")
                        {
                            //MsgHelper.ShowInformation("处理完成!");
                        }
                        else
                        {
                            listFalse.Add("第" + iIndex + "条发生错误:" + res1);
                        }
                    }

                    if (listFalse.Count > 0)
                    {
                        string mes = "";
                        foreach (var sub in listFalse)
                        {
                            mes += sub + "\r\n";
                        }

                        MsgHelper.ShowError(mes);
                    }
                }
                catch (Exception ee)
                {
                    tumMessage = ee.ToStr();
                }

                break;
            }
        }
Esempio n. 9
0
        public FrmConfig()
        {
            InitializeComponent();

            txtUrl.Text = IniHelper.ReadString(Global.IniUrl, "CONFIG", "URL", "");
        }