예제 #1
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;
         }
     }
 }
예제 #2
0
 private void DoAdd()
 {
     Model.BarCodeCreateRecord BarCodeCreateRecord = new Model.BarCodeCreateRecord();
     BLL.BarCodeCreateRecord   bll        = new BLL.BarCodeCreateRecord();
     Model.manager             adminmodel = Session[DTKeys.SESSION_ADMIN_INFO] as Model.manager;
     BarCodeCreateRecord.GoodCount      = int.Parse(txtGoodCount.Text);
     BarCodeCreateRecord.BoxSum         = Convert.ToInt32(txtBoxsum.Text.Trim());
     BarCodeCreateRecord.RetrospectCode = txtRetrospect.Text;
     BarCodeCreateRecord.Operator       = adminmodel.id;
     BarCodeCreateRecord.Batch          = txtBatch.Text.Trim();
     BarCodeCreateRecord.State          = 1;
     BarCodeCreateRecord.CreateTime     = DateTime.Now;
     BarCodeCreateRecord.Remark         = txtRemark.Text;
     BarCodeCreateRecord.GoodBarCode    = txtGoodBarCode.Text.Trim();
     //BarCodeCreateRecord.BrokerageRatio = Convert.ToDecimal(txtBrokerageRatio.Text.Trim());
     //BarCodeCreateRecord.IntegralRatio = Convert.ToInt32(txtIntegralRatio.Text.Trim());
     Model.BarCode BarCode = new Model.BarCode();
     BarCode.CreateTime = DateTime.Now;
     BarCode.State      = 1;
     Model.GoodCategory gc    = new Model.GoodCategory();
     BLL.GoodCategory   bllgc = new BLL.GoodCategory();
     try
     {
         bll.Add(BarCodeCreateRecord, BarCode);
         int i = bll.GetMaxID();
         if (i != 0)
         {
             ExcelOut(i.ToString());
             Response.Redirect("/admin/BarCode/BarCodeCreateDetail.aspx?id=" + i);
         }
     }
     catch (Exception e)
     {
     }
 }
예제 #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DTcms.BLL.IntegralManage      bllIntegralManage      = new BLL.IntegralManage();
            DTcms.BLL.BarCode             bllBarCode             = new BLL.BarCode();
            DTcms.BLL.BarCodeCreateRecord bllBarCodeCreateRecord = new BLL.BarCodeCreateRecord();
            DTcms.BLL.GoodCategory        bllGoodCategory        = new BLL.GoodCategory();
            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.IntegralManage>      listIntegralManage      = bllIntegralManage.GetList();
                List <Model.BarCode>             listBarCode             = bllBarCode.GetList();
                List <Model.BarCodeCreateRecord> listBarCodeCreateRecord = bllBarCodeCreateRecord.GetList();
                List <Model.GoodCategory>        listGoodCategory        = bllGoodCategory.GetList();
                var query = listIntegralManage.Join(listBarCode, i => i.IntegralCode, b => b.IntegralCode, (i, b) => new { IntegralManageID = i.IntegralManageID, IntegralCode = i.IntegralCode, CreateTime = i.CreateTime, Remark = i.Remark, BarCodeCreateRecordID = b.BarCodeCreateRecordID })
                            .Join(listBarCodeCreateRecord, a => a.BarCodeCreateRecordID, c => c.BarCodeCreateRecordID, (a, c) => new { IntegralManageID = a.IntegralManageID, IntegralCode = a.IntegralCode, CreateTime = a.CreateTime, Remark = a.Remark, GoodCategoryID = c.GoodCategoryID })
                            .Join(listGoodCategory, d => d.GoodCategoryID, g => g.GoodCategoryID, (d, g) => new { IntegralManageID = d.IntegralManageID, IntegralCode = d.IntegralCode, CreateTime = d.CreateTime, Remark = d.Remark, IntegralRatio = g.IntegralRatio });
                if (context.Request.QueryString["code"] != null)
                {
                    query = query.Where(i => i.IntegralCode == context.Request.QueryString["code"]);
                }
                //query = query.Join(listBarCodeCreateRecord, i => i.BarCodeCreateRecordID, c => c.BarCodeCreateRecordID, (i, c) => new { IntegralManageID = i.IntegralManageID, IntegralCode = i.IntegralCode, CreateTime = i.CreateTime, Remark = i.Remark, GoodCategoryID = c.GoodCategoryID });
                //query = query.Join(listBarCodeCreateRecord, i => i.BarCodeCreateRecordID, c => c.BarCodeCreateRecordID, (i, c) => new { aaa=i.BarCodeCreateRecordID});
                string json = JsonConvert.SerializeObject(query);
                context.Response.Write(json);
                //context.Response.Write("{\"total\":" + "\"" + 50 + "\"" + ",\"rows\":" + json + "}");
                break;
            }
        }
예제 #4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string id = context.Request.QueryString["id"];

            Model.GoodCategory model = null;
            BLL.GoodCategory   bll   = new BLL.GoodCategory();
            try
            {
                model = bll.GetModel(id);
                if (model != null)
                {
                    context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(model));
                }
            }
            catch (Exception)
            {}
        }
예제 #5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DTcms.BLL.GoodCategory bll = new BLL.GoodCategory();
            string  type = context.Request.QueryString["type"];
            DataSet ds   = null;

            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;
                    ds = bll.GetList(pageSize, pageIndex, "", "GoodCategoryID", out recordCount);
                    IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
                    timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                    string json = JsonConvert.SerializeObject(ds.Tables[0], new DataTableConverter(), timeFormat);
                    context.Response.Write("{\"total\":" + "\"" + recordCount + "\"" + ",\"rows\":" + json + "}");
                }
                catch (Exception)
                { }
                break;

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

            case "exit":
                ds = bll.GetGoodCategoryByName(context.Request.Form["param"]);
                if (ds == null)
                {
                    context.Response.Write("{\"info\":\"验证通过!\",\"status\":\"y\"}");
                }
                else
                {
                    context.Response.Write("{\"info\":\"该商品已存在!\",\"status\":\"n\"}");
                }
                break;
            }
        }
예제 #6
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            BLL.BarCodeCreateRecord          bllBarCodeCreateRecord  = new BLL.BarCodeCreateRecord();
            BLL.GoodCategory                 bllGoodCategory         = new BLL.GoodCategory();
            List <Model.BarCodeCreateRecord> listBarCodeCreateRecord = bllBarCodeCreateRecord.GetList();
            List <Model.GoodCategory>        listGoodCategory        = bllGoodCategory.GetList();
            var query = listGoodCategory.Where(g => g.GoodCategoryName == "旭贝尔乳基婴儿配方奶粉 1段(0-12个月)铁罐900g").Join(listBarCodeCreateRecord, g => g.GoodCategoryID, b => b.GoodCategoryID, (g, b) => new { g.Standard }).ToList();
            //listBarCodeCreateRecord.Join(listGoodCategory,b=>b.GoodCategoryID,g=>g.GoodCategoryID);
            int param = int.Parse(context.Request.Form["param"]);

            if (query.Count() == 0 || param % query[0].Standard > 0)
            {
                context.Response.Write("{ \"info\":\"请输入" + query[0].Standard + "的倍数\", \"status\":\"n\" }");
            }
            else
            {
                context.Response.Write("{ \"info\":\"\", \"status\":\"y\" }");
            }
        }
예제 #7
0
        private void Edit()
        {
            Model.manager      adminmodel = Session[DTKeys.SESSION_ADMIN_INFO] as Model.manager;
            Model.GoodCategory model      = new Model.GoodCategory();
            BLL.GoodCategory   bll        = new BLL.GoodCategory();
            model.GoodCategoryID   = int.Parse(Request.QueryString["GoodCategoryID"]);
            model.ClientID         = int.Parse(ddlGroupId.SelectedValue);
            model.GoodCategoryName = txtGoodCategoryName.Text;
            model.BrokerageRatio   = decimal.Parse(txtBrokerageRatio.Text);
            model.IntegralRatio    = int.Parse(txtIntegralRatio.Text);
            //model.GoodBarCode = txtGoodBarCode.Text;
            model.Operator = adminmodel.id;
            //model.Standard = int.Parse(txtStandard.Text);
            model.State      = int.Parse(drpState.SelectedValue);
            model.CreateTime = DateTime.Now;
            model.Remark     = txtRemark.Text;

            if (bll.Edit(model) > 0)
            {
                Response.Redirect("/admin/client/ClientGoodList.aspx");
            }
        }
예제 #8
0
        public void ExcelOut(HttpContext context, string id)
        {
            BLL.BarCodeCreateRecord          bllbcr = new BLL.BarCodeCreateRecord();
            BLL.GoodCategory                 bllgc  = new BLL.GoodCategory();
            List <Model.GoodCategory>        gList  = bllgc.GetList();
            List <Model.BarCodeCreateRecord> bList  = bllbcr.GetList();
            var model = bList.Where(b => b.BarCodeCreateRecordID == int.Parse(id)).ToList();
            //var model = bList.Join(gList, b => b.GoodCategoryID, g => g.GoodCategoryID, (b, g) => new { GoodCategoryName = g.GoodCategoryName, BarCodeCreateRecordID = b.BarCodeCreateRecordID, DownLoad=b.DownLoad }).Where(b => b.BarCodeCreateRecordID == int.Parse(id)).ToList();
            //Model.BarCodeCreateRecord model = bllbcr.GetModel(id);
            string   aaa          = context.Server.MapPath("/DownLoad/");
            string   FullFileName = aaa + model[0].DownLoad + ".txt";
            FileInfo DownloadFile = new FileInfo(FullFileName);

            context.Response.Clear();
            context.Response.ClearHeaders();
            context.Response.Buffer      = false;
            context.Response.ContentType = "application/octet-stream";
            //context.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(model[0].GoodCategoryName+".txt", System.Text.Encoding.UTF8));
            context.Response.AppendHeader("Content-Disposition", "attachment;filename=" + model[0].RetrospectCode + ".txt");
            context.Response.AppendHeader("Content-Length", DownloadFile.Length.ToString());
            context.Response.WriteFile(DownloadFile.FullName);
            context.Response.Flush();
            context.Response.End();
        }
예제 #9
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;
            }
        }