Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DTcms.BLL.OutWarehouse bll       = new BLL.OutWarehouse();
            BLL.Client             bllClient = new BLL.Client();
            string type = context.Request.QueryString["type"];

            switch (type)
            {
            case "select":
                int pageIndex = int.Parse(context.Request.Form["page"]);
                int pageSize  = int.Parse(context.Request.Form["rows"]);
                List <Model.OutWarehouse> listOutWarehouse = bll.GetList();
                List <Model.Client>       listClient       = bllClient.GetList();
                var list     = listOutWarehouse.Join(listClient, p => p.ClientID, c => c.ClientID, (p, c) => new { OutWarehouseID = p.OutWarehouseID, ClientName = c.ClientName, LogisticsCode = p.LogisticsCode, CreateTime = p.CreateTime.Date, Remark = p.Remark });
                var listPage = (from c in list
                                select c).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
                IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
                timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                string json = JsonConvert.SerializeObject(listPage, timeFormat);
                context.Response.Write("{\"total\":" + "\"" + list.Count() + "\"" + ",\"rows\":" + json + "}");
                break;

            case "del":
                bll.Delete(context.Request.QueryString["ids"]);
                break;
            }
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         List <Model.Client> list = new BLL.Client().GetList();
         ddlGroupId.DataSource     = list;
         ddlGroupId.DataTextField  = "ClientName";
         ddlGroupId.DataValueField = "ClientID";
         ddlGroupId.DataBind();
         if (Request.QueryString["GoodCategoryID"] != null)
         {
             txtGoodCategoryName.ReadOnly = true;
             txtGoodCategoryName.Attributes.Remove("ajaxurl");
             BLL.GoodCategory   bll   = new BLL.GoodCategory();
             Model.GoodCategory model = new Model.GoodCategory();
             model = bll.GetModel(Request.QueryString["GoodCategoryID"]);
             txtGoodCategoryName.Text = model.GoodCategoryName;
             //txtGoodBarCode.Text = model.GoodBarCode.ToString();
             //txtGoodBarCode.Text = model.GoodBarCode.ToString();
             txtBrokerageRatio.Text = model.BrokerageRatio.ToString();
             txtIntegralRatio.Text  = model.IntegralRatio.ToString();
             //txtStandard.Text = model.Standard.ToString();
             drpState.SelectedValue = model.State.ToString();
             txtRemark.Text         = model.Remark;
         }
     }
 }
        private void btnaction_Click(object sender, EventArgs e)
        {
            int    typeid = 0, manid = 0;
            double amnt = 0, clprc = 0, PaidMoney = 0;
            string det = "";

            BLL.Types tppp = null;
            try
            {
                typeid    = int.Parse(combotypes.SelectedValue.ToString());
                manid     = int.Parse(combocompany.SelectedValue.ToString());
                amnt      = double.Parse(txtamount.Text);
                clprc     = double.Parse(txtclntprice.Text);
                PaidMoney = double.Parse(txtpaidmny.Text);
                det       = txtdet.Text;
                tppp      = (BLL.Types)combotypes.SelectedItem;
                TheUnito TheUnito = TheUnito.Kilo;
                TheUnito = (TheUnito)Enum.Parse(typeof(TheUnito), Globals.Globals.gram.ToString());
                if (id > 0)
                {
                    //  MessageBox.Show(string.Format("{0}  {1} {2} {3} {4} {5} {6}",id.ToString(), typeid.ToString(), manid.ToString(), amnt.ToString(), clprc.ToString(), PaidMoney.ToString(), det));
                    BLL.SalesReturns.UpdateClientDeal(id, typeid, manid, amnt, clprc, PaidMoney, det, 0, combocompany.Text, combotypes.Text);
                    dataGridView1.DataSource = BLL.SalesReturns.GetAllClientDeal();
                }
                else
                {
                    double stramnt = amnt;
                    if (Globals.Globals.gram == 0)
                    {
                        stramnt = amnt / 1000;
                    }
                    BLL.Store.InsertStoreFromClient(typeid, stramnt, DateTime.Now, combotypes.Text, true);
                    BLL.SalesReturns.InsertClientDeal(0, typeid, manid, amnt, clprc, amnt * clprc, det, TheUnito, tppp.BusinessPrice, combocompany.Text, combotypes.Text);

                    BLL.Client clo = BLL.Client.GetClientByID(manid);
                    if (clo.ID != Globals.Globals.UnknownClient)
                    {
                        clo.Balance -= ((amnt * clprc)); clo.UpdateClient();
                        BLL.BllGlobal.UpdateAllClients();
                    }
                    dataGridView1.DataSource = BLL.SalesReturns.GetAllClientDeal();
                }

                btnnew_Click(sender, e);
            }
            catch { SelectTheEmptyText(this.groupBox1); }
        }
Пример #4
0
 private void Add()
 {
     BLL.Client   bll   = new BLL.Client();
     Model.Client model = new Model.Client();
     model.UniqueID      = Guid.NewGuid();
     model.ClientAccount = txtClientAccount.Text;
     model.ClientName    = txtClientName.Text;
     model.Phone         = txtPhone.Text;
     model.Email         = txtEmail.Text;
     model.ClientAddress = txtClientAddress.Text;
     model.CreateTime    = DateTime.Now;
     model.State         = 1;
     model.Remark        = txtRemark.Text;
     if (bll.Add(model) > 0)
     {
         Response.Redirect("/admin/client/ClientList.aspx");
     }
 }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["ClientID"] != null)
         {
             txtClientAccount.ReadOnly = true;
             BLL.Client   bll   = new BLL.Client();
             Model.Client model = new Model.Client();
             model = bll.GetModel(Request.QueryString["ClientID"]);
             txtClientAccount.Text = model.ClientAccount;
             txtClientName.Text    = model.ClientName;
             txtPhone.Text         = model.Phone;
             txtClientAddress.Text = model.ClientAddress;
             txtEmail.Text         = model.Email;
             txtRemark.Text        = model.Remark;
             txtClientAccount.Attributes.Remove("ajaxurl");
         }
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;
            BLL.Client clno = (BLL.Client)cmcmps.SelectedItem;
            if (clno.Balance >= 0)
            {
                clno.Balance = clno.Balance - double.Parse(numbertextbox1.Text);
            }
            else
            {
                clno.Balance = clno.Balance + double.Parse(numbertextbox1.Text);
            }

            clno.UpdateClient();
            BLL.BllGlobal.UpdateAllClients();
            BLL.ListClienttAccount.InsertListClienttAccount(int.Parse(cmcmps.SelectedValue.ToString()), double.Parse(label10.Text), double.Parse(numbertextbox1.Text), (double.Parse(label10.Text) - double.Parse(numbertextbox1.Text)));
            cmcmps_SelectedIndexChanged(Sendo, eo);
            button1.Enabled = true;
            clno            = null;
        }
Пример #7
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DTcms.BLL.Client bll  = new BLL.Client();
            DataSet          ds   = null;
            string           type = context.Request.QueryString["type"];

            switch (type)
            {
            case "select":
                int pageIndex                = int.Parse(context.Request.Form["page"]);
                int pageSize                 = int.Parse(context.Request.Form["rows"]);
                List <Model.Client> list     = bll.GetList();
                List <Model.Client> listPage = (from c in list
                                                select c).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
                IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
                timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                string json = JsonConvert.SerializeObject(listPage, timeFormat);
                context.Response.Write("{\"total\":" + "\"" + list.Count + "\"" + ",\"rows\":" + json + "}");
                break;

            case "del":
                bll.Delete(context.Request.QueryString["ids"]);
                break;

            case "exit":
                ds = bll.GetClientByName(context.Request.Form["param"]);
                if (ds == null)
                {
                    context.Response.Write("{\"info\":\"验证通过!\",\"status\":\"y\"}");
                }
                else
                {
                    context.Response.Write("{\"info\":\"该客户已存在!\",\"status\":\"n\"}");
                }
                break;
            }
        }
Пример #8
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DTcms.BLL.Promotion bll             = new BLL.Promotion();
            BLL.Client          bllClient       = new BLL.Client();
            BLL.GoodCategory    bllGoodCategory = new BLL.GoodCategory();
            BLL.BarCode         bllbarcode      = new BLL.BarCode();
            string type = context.Request.QueryString["type"];

            switch (type)
            {
            case "select":
                int pageIndex = int.Parse(context.Request.Form["page"].ToString());
                int pageSize  = int.Parse(context.Request.Form["rows"].ToString());
                try
                {
                    int                  recordCount = 0;
                    Model.manager        adminmodel  = context.Session[DTKeys.SESSION_ADMIN_INFO] as Model.manager;
                    DataSet              ds          = bll.GetList(pageSize, pageIndex, "m.id=" + adminmodel.id, "PromotionID", out recordCount);
                    DataTable            dt          = ds.Tables[0];
                    string               result      = "";
                    IsoDateTimeConverter timeFormat  = new IsoDateTimeConverter();
                    timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                    result = JsonConvert.SerializeObject(dt, new DataTableConverter(), timeFormat);
                    context.Response.Write("{\"total\":" + "\"" + recordCount + "\"" + ",\"rows\":" + result + "}");
                }
                catch (Exception)
                {
                }
                break;

            case "del":
                bll.Delete(context.Request.QueryString["ids"]);
                break;
            }
        }
Пример #9
0
        private void btnaction_Click(object sender, EventArgs e)
        {
            int    typeid = 0, manid = 0;
            double amnt = 0, clprc = 0, PaidMoney = 0;
            string det = "";

            BLL.Types tppp = null;
            try
            {
                typeid    = int.Parse(combotypes.SelectedValue.ToString());
                manid     = int.Parse(combocompany.SelectedValue.ToString());
                amnt      = double.Parse(txtamount.Text);
                clprc     = double.Parse(txtclntprice.Text);
                PaidMoney = double.Parse(txtpaidmny.Text);
                det       = txtdet.Text;
                tppp      = (BLL.Types)combotypes.SelectedItem;
                TheUnito TheUnito = TheUnito.Kilo;
                TheUnito = (TheUnito)Enum.Parse(typeof(TheUnito), Globals.Globals.gram.ToString());
                if (id > 0)
                {
                    //  MessageBox.Show(string.Format("{0}  {1} {2} {3} {4} {5} {6}",id.ToString(), typeid.ToString(), manid.ToString(), amnt.ToString(), clprc.ToString(), PaidMoney.ToString(), det));
                    BLL.ClientDeal.UpdateClientDeal(id, typeid, manid, amnt, clprc, PaidMoney, det, 0, combocompany.Text, combotypes.Text);
                    dataGridView1.DataSource = BLL.ClientDeal.GetAllClientDeal();
                }
                else
                {
                    double stramnt = amnt;
                    if (Globals.Globals.gram == 0)
                    {
                        stramnt = amnt / 1000;
                    }
                    if (BLL.Store.InsertStoreFromClient(typeid, stramnt, DateTime.Now, combotypes.Text) == 0)
                    {
                        return;
                    }

                    BLL.ClientDeal.InsertClientDeal(0, typeid, manid, amnt, clprc, amnt * clprc, det, TheUnito, tppp.BusinessPrice, combocompany.Text, combotypes.Text);
                    BLL.Client clo = BLL.Client.GetClientByID(manid); clo.Balance += ((amnt * clprc) - PaidMoney); clo.UpdateClient();
                    //print
                    if (Globals.Globals.PrintWhenSell)
                    {
                        try
                        {
                            List <BLL.ClientDeal> curclnoo = new List <BLL.ClientDeal>();
                            BLL.ClientDeal        cr       = new ClientDeal(0, typeid, manid, amnt, clprc, amnt * clprc, det, MyDateTime.Now, TheUnito, tppp.BusinessPrice, combocompany.Text, combotypes.Text);
                            curclnoo.Add(cr);
                            dataGridView1.DataSource = curclnoo;
                            if ((int)combocompany.SelectedValue != Globals.Globals.UnknownClient)
                            {
                                Globals.Globals.PrintNow(dataGridView1, @"السيد المحترم " + combocompany.Text, " المدفوع " + PaidMoney.ToString() + " ل.س "
                                                         + Environment.NewLine + " الباقي " + ((amnt * clprc) - PaidMoney).ToString() + " ل.س "
                                                         + Environment.NewLine + string.Format("المجموع {0} ل.س ", (amnt * clprc).ToString()), true);
                            }
                            else
                            {
                                Globals.Globals.PrintNow(dataGridView1, @"بتوقيت:", string.Format("المجموع {0} ل.س ", ((amnt * clprc).ToString())), true);
                            }
                        }
                        catch { }
                    }

                    //end print
                    BLL.BllGlobal.UpdateAllClients();
                    if (txtpaidmny.Text.Length > 0)
                    {
                        if (double.Parse(handclnt.Text) > PaidMoney)
                        {
                            MessageBox.Show(" الباقي للزبون   " + (double.Parse(handclnt.Text) - PaidMoney).ToString() + "  ل.س  ");
                        }
                    }
                    dataGridView1.DataSource = BLL.ClientDeal.GetAllClientDeal();
                }

                btnnew_Click(sender, e);
            }
            catch { SelectTheEmptyText(this.groupBox1); }
        }