Example #1
0
        public Dictionary <string, Model.bi_t_supcust_info> GetDic()
        {
            IBLL.ICus cusBLL = new BLL.Cus();
            var       lst    = cusBLL.GetList("");
            Dictionary <string, Model.bi_t_supcust_info> dic = new Dictionary <string, Model.bi_t_supcust_info>();

            foreach (Model.bi_t_supcust_info item in lst)
            {
                var it = new Model.bi_t_supcust_info();
                if (dic.TryGetValue(item.supcust_no, out it) == false)
                {
                    dic.Add(item.supcust_no, item);
                }
            }
            return(dic);
        }
Example #2
0
        void IServiceBase.Request(string t, string pars, out string res)
        {
            try
            {
                WebHelper web = new WebHelper(pars);
                ReadWriteContext.IReadContext r = new ReadWriteContext.ReadContextByJson(pars);
                var       kv  = r.ToDictionary();
                IBLL.ICus bll = new BLL.Cus();
                if (t == "get_list")
                {
                    string region_no   = r.Read("region_no");
                    string keyword     = r.Read("keyword");
                    int    show_stop   = Helper.Conv.ToInt32(r.Read("show_stop"));
                    int    page_index  = Helper.Conv.ToInt32(r.Read("page_index"));
                    int    page_size   = Helper.Conv.ToInt32(r.Read("page_size"));
                    int    total_count = 0;

                    var tb = bll.GetList(region_no, keyword, show_stop, page_index, page_size, out total_count);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    w.Append("total_count", total_count.ToString());
                    res = w.ToString();
                }
                else if (t == "get_item")
                {
                    string supcust_no = r.Read("supcust_no");
                    var    tb         = bll.GetItem(supcust_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("data", tb);
                    res = w.ToString();
                }
                else if (t == "max_code")
                {
                    string code = bll.MaxCode();
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    w.Append("code", code);
                    res = w.ToString();
                }
                else if (t == "add")
                {
                    Model.bi_t_supcust_info item = new Model.bi_t_supcust_info();
                    item.supcust_no   = r.Read("supcust_no");
                    item.supcust_flag = r.Read("supcust_flag");
                    item.sup_name     = r.Read("sup_name");
                    item.region_no    = r.Read("region_no");
                    item.sup_type     = r.Read("sup_type");
                    item.sup_man      = r.Read("sup_man");
                    item.sup_addr     = r.Read("sup_addr");

                    item.sup_email = r.Read("sup_email");
                    item.sup_tel   = r.Read("sup_tel");

                    item.display_flag = r.Read("display_flag");
                    item.credit_amt   = Helper.Conv.ToDecimal(r.Read("credit_amt"));
                    item.sale_man     = r.Read("sale_man");
                    item.sup_pyname   = r.Read("sup_pyname");
                    item.other1       = r.Read("other1");
                    item.cust_level   = r.Read("cust_level");
                    item.is_retail    = r.Read("is_retail");

                    bll.Add(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");
                    res = w.ToString();
                }
                else if (t == "change")
                {
                    Model.bi_t_supcust_info item = new Model.bi_t_supcust_info();
                    item.supcust_no   = r.Read("supcust_no");
                    item.supcust_flag = r.Read("supcust_flag");
                    item.sup_name     = r.Read("sup_name");
                    item.region_no    = r.Read("region_no");
                    item.sup_type     = r.Read("sup_type");
                    item.sup_man      = r.Read("sup_man");
                    item.sup_addr     = r.Read("sup_addr");
                    item.sup_email    = r.Read("sup_email");
                    item.sup_tel      = r.Read("sup_tel");

                    item.display_flag = r.Read("display_flag");
                    item.credit_amt   = Helper.Conv.ToDecimal(r.Read("credit_amt"));
                    item.sale_man     = r.Read("sale_man");
                    item.sup_pyname   = r.Read("sup_pyname");
                    item.other1       = r.Read("other1");
                    item.cust_level   = r.Read("cust_level");
                    item.is_retail    = r.Read("is_retail");
                    bll.Change(item);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else if (t == "delete")
                {
                    string supcust_no = r.Read("supcust_no");
                    bll.Delete(supcust_no);
                    ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                    w.Append("errId", "0");
                    w.Append("errMsg", "");

                    res = w.ToString();
                }
                else
                {
                    web.ReflectionMethod(bll, t);
                    res = web.NmJson();
                }
            }
            catch (Exception ex)
            {
                ReadWriteContext.IWriteContext w = new ReadWriteContext.WriteContextByJson();
                w.Append("errId", "-1");
                w.Append("errMsg", ex.Message);
                res = w.ToString();
            }
        }
Example #3
0
        public ChooseCus()
        {
            InitializeComponent();
            //
            cons.AddClickAct.Add2(label3);
            cons.AddClickAct.Add2(label4);

            //软键盘初始化
            pnlboard.Tag = lbl;
            // this.Controls.Add(pnlboard);
            pnlboard.TabStop = false;
            // pnlboard.BringToFront();
            pnlboard.Controls.Clear();
            string[] lines       = new string[] { "1234567890", "QWERTYUIOP", "ASDFGHJKL", "!ZXCVBNM@" };
            int      linecount   = 4;
            int      columncount = 10;
            int      lineheight  = (pnlboard.Height - 1) / linecount;
            int      columnwidth = (pnlboard.Width - 1) / columncount;
            int      itop        = 0;
            int      ileft       = 0;

            for (int i = 0; i < 4; i++)
            {
                itop = i * lineheight + 1;
                if (i == 0)
                {
                    ileft = 1;
                }
                else if (i == 1)
                {
                    ileft = 1;
                }
                else if (i == 2)
                {
                    ileft = columnwidth / 2 + 1;
                }
                else if (i == 3)
                {
                    ileft = columnwidth / 2 + 1;
                }

                foreach (char c in lines[i])
                {
                    control.ankey con = new control.ankey();
                    con.BackColor = pnlboard.BackColor;
                    con.TabStop   = false;

                    if (c == '!')
                    {
                        con.Text = "删除";
                    }
                    else if (c == '@')
                    {
                        con.Text = "取消";
                    }
                    else
                    {
                        con.Text = c.ToString();
                    }

                    con.Width  = columnwidth - 2;
                    con.Height = lineheight - 2;
                    //con.BackColor = Color.Aqua;
                    con.Top        = itop;
                    con.Left       = ileft;
                    con.MouseDown += this.con_click;
                    ileft         += columnwidth;
                    pnlboard.Controls.Add(con);
                }
            }
            try
            {
                IBLL.ICus cusBLL = new BLL.Cus();
                cusList = cusBLL.GetList("");
                foreach (Model.bi_t_supcust_info item in cusList)
                {
                    cusListAll.Add(item);
                }
            }
            catch (Exception ex)
            {
                new MsgForm(ex.GetMessage()).ShowDialog();
            }
        }