示例#1
0
        private void onSearch(v_lhproducts_policyModel where)
        {
            var action = new Action(() =>
            {
                PageResult <v_lhproducts_policyModel> result = null;
                string countStr = $"第【{page}】页/共【{count}】页";

                try
                {
                    btnNext.Enabled = btnLast.Enabled = btn查询.Enabled = btn重置.Enabled = btnConfirm.Enabled = btnReturn.Enabled = false;
                    result          = _service.GetPolicyProducts(header, where, page, size);

                    total = result.Total;

                    count  = total / size;
                    count += total % size > 0 ? 1 : 0;

                    countStr = $"第【{page}】页/共【{count}】页";

                    labCount.Text          = countStr;
                    gridControl.DataSource = result.Result;

                    btnNext.Enabled   = btnLast.Enabled =
                        btn查询.Enabled = btn重置.Enabled = btnConfirm.Enabled = btnReturn.Enabled = true;
                }
                catch (Exception e)
                {
                    MsgHelper.ShowInformation(e.Message);
                }
            });

            var t1 = new ThreadStart(action);

            t1.Invoke();
        }
        private V_ICPOBILLENTRYMODEL PolicyProductToICPOBillEntry(v_lhproducts_policyModel data)
        {
            V_ICPOBILLENTRYMODEL result = new V_ICPOBILLENTRYMODEL();

            result.FITEMID      = data.PRODCODE;
            result.FPRODUCTNAME = data.PRODNAME;
            result.FPRODUCTTYPE = data.LHPRODTYPE;
            result.FPRODUCTCODE = data.PRODCODE;
            result.FSRCQTY      = 0;

            result.Famount = result.FPRICE * result.FSRCQTY;

            result.FSRCNAME  = "";
            result.FSRCMODEL = data.LHPRODTYPE + "||" + data.PRODSTANDARD + "||" + data.PRODMODEL;
            result.FSRCCODE  = data.PRODCODE;

            result.MINIMUMQUANTITY = data.MINIMUMQUANTITY;
            result.CAPPINGQUANTITY = data.CAPPINGQUANTITY;
            result.DISCOUNTRATE    = data.DISCOUNTRATE;

            result.LH_DCTPOLICYROWTYPE  = data.POLICYITEMTYPE;
            result.LH_DCTPOLICYPRODNAME = data.PRODNAME;

            if (data.SPECIALOFFER != null)
            {
                result.FPRICE = data.SPECIALOFFER.Value;
            }
            result.LH_DCTPOLICYITEMID = data.ITEMID;

            return(result);
        }
示例#3
0
 private v_lhproducts_policyModel GetWhere()
 {
     var where          = new v_lhproducts_policyModel();
     where.PRODNAME     = txtFactoryName.Text;
     where.PRODMODEL    = txtFactoryModel.Text;
     where.PRODSTANDARD = txtSpecifications.Text;
     return(where);
 }
示例#4
0
 private void gridControl_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         var list = new List <v_lhproducts_policyModel>(gridControl.DataSource as v_lhproducts_policyModel[]);
         this.SelectData   = list[gridView名称代码.GetDataSourceRowIndex(gridView名称代码.FocusedRowHandle)];
         this.SelectID     = gridView名称代码.GetRowCellValue(gridView名称代码.FocusedRowHandle, "HEADID").ToString();
         this.SelectName   = gridView名称代码.GetRowCellValue(gridView名称代码.FocusedRowHandle, "POLICYNAME").ToString();
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }
        public PageResult <v_lhproducts_policyModel> GetPolicyProducts(ICPOBILL_PolicyDTO header,
                                                                       v_lhproducts_policyModel where, int index = 1, int size = 35)
        {
            where = ComputeWhere(header, where);
            var helper = new OracleDBHelper();
            var total  = 0;

            string whereStr = helper.GetWhereStr(where);

            List <v_lhproducts_policyModel> resultList = new List <v_lhproducts_policyModel>();

            if (string.IsNullOrEmpty(header.HeadID))
            {
                List <V_LHPRODUCTS_UNPOLICYHEADID> data =
                    helper.GetWithWhereStrByPage <V_LHPRODUCTS_UNPOLICYHEADID>(whereStr, where, index, size);

                total = helper.Count <V_LHPRODUCTS_UNPOLICYHEADID>(whereStr);

                var t = typeof(V_LHPRODUCTS_UNPOLICYHEADID);

                var pis = t.GetProperties().ToList();

                data.ForEach(p =>
                {
                    var item = new v_lhproducts_policyModel();
                    pis.ForEach(pi =>
                    {
                        var value = pi.GetValue(p, null);
                        pi.SetValue(item, value);
                    });
                    resultList.Add(item);
                });
            }
            else
            {
                List <v_lhproducts_policyModel> data =
                    helper.GetWithWhereStrByPage <v_lhproducts_policyModel>(whereStr, where, index, size);

                total      = helper.Count <v_lhproducts_policyModel>(whereStr);
                resultList = data;
            }

            PageResult <v_lhproducts_policyModel> result = new PageResult <v_lhproducts_policyModel>()
            {
                Total = total, Result = resultList
            };

            return(result);
        }
        private v_lhproducts_policyModel ComputeWhere(ICPOBILL_PolicyDTO header, v_lhproducts_policyModel where)
        {
            CheckNull(header);

            where.LHPRODTYPE = header.BrandName;

            switch (header.OrderType)
            {
            //常规订单
            case "Common":
            {
                where.LHPRODSIGN = "成品";
                break;
            }

            //配件订单
            case "Parts":
            {
                where.LHPRODSIGN = "配件";
                break;
            }

            //广告物料申请单
            case "Advertise":
            {
                where.LHPRODSIGN = "广告物料";
                where.LHPRODTYPE = "广告用品";
                break;
            }
            }

            where.HEADID = string.IsNullOrEmpty(header.HeadID) ? null : header.HeadID;

            if (!string.IsNullOrEmpty(header.HeadID))
            {
                where.DEPTNAME     = header.BrandName.Contains("事业部") ? header.BrandName : $"{header.BrandName}事业部";
                where.ORDERTYPE    = header.OrderType;
                where.ORDERSUBTYPE = header.OrderSubType;
                where.ACCTCODES    = header.Account;
            }

            where.LHPRODCHANNEL = header.Channel;

            return(where);
        }
 public PageResult <v_lhproducts_policyModel> GetPolicyProducts(ICPOBILL_PolicyDTO header,
                                                                v_lhproducts_policyModel where, int index = 1, int size = 35)
 {
     return(methods.GetPolicyProducts(header, where, index, size));
 }