Beispiel #1
0
        private void sellerCancelSupply(HttpRequest request, HttpResponse response)
        {
            try
            {
                int srId = 0;
                int.TryParse(request.QueryString["srId"], out srId);
                int cancelSuplly = -1;
                int.TryParse(request.QueryString["supllyStatus"], out cancelSuplly);

                SellerRangeEntity sr = new SellerRangeEntity();
                sr.SrId = srId;
                sr.IsCancel = (cancelSuplly == 1);
                int adminId = 0;

                if (!string.IsNullOrEmpty(request.QueryString["w"]))
                {
                    if (request.QueryString["w"] == "a")
                    {
                        adminId = logic.sysAdmin.AdminID;
                    }
                    else if (request.QueryString["w"] == "f")
                    {
                        adminId = logic.customer.userId;
                    }
                }

                sr.AdminId = adminId;
                logic.sellerRange.updateCancel(sr);

                SellerRangeEntity curSellerRange = logic.sellerRange.getById(srId);

                DataTable dt = logic.price.listWithBusinessNatures(curSellerRange.ProductId, curSellerRange.CompanyId);
                using (JsonTextWriter jsonWriter = new JsonTextWriter(response.Output))
                {
                    jsonWriter.WriteStartObject();
                    jsonWriter.WritePropertyName("code");
                    jsonWriter.WriteValue("1");
                    jsonWriter.WritePropertyName("productId");
                    jsonWriter.WriteValue(curSellerRange.ProductId);
                    jsonWriter.WritePropertyName("priceArray");

                    jsonWriter.WriteStartArray();
                    foreach (DataRow row in dt.Rows)
                    {
                        jsonWriter.WriteStartObject();

                        jsonWriter.WritePropertyName("businessNatureName");
                        jsonWriter.WriteValue(row["businessNatureName"]);
                        jsonWriter.WritePropertyName("sellerPrice");
                        jsonWriter.WriteValue(string.Format("{0:F2}", row["sellerPrice"]));
                        jsonWriter.WritePropertyName("businessNature");
                        jsonWriter.WriteValue(row["businessNature"]);
                        jsonWriter.WritePropertyName("unit");
                        jsonWriter.WriteValue(row["unit"]);

                        jsonWriter.WriteEndObject();
                    }
                    jsonWriter.WriteEndArray();

                    jsonWriter.WriteEndObject();
                }
            }
            catch (Exception ex)
            {
                logic.sysLog.insertFacade(ex.Message);
                using (JsonTextWriter jsonWriter = new JsonTextWriter(response.Output))
                {
                    jsonWriter.WriteStartObject();
                    jsonWriter.WritePropertyName("code");
                    jsonWriter.WriteValue("1");
                    jsonWriter.WriteEndObject();
                }
            }
        }
Beispiel #2
0
 public static void updateCancel(SellerRangeEntity sr)
 {
     SellerRange.updateCancel(sr);
 }
        protected void rpt_list_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "SelectProduct")
            {
                string[] array=e.CommandArgument.ToString().Split(new char[] { ',' },StringSplitOptions.RemoveEmptyEntries);
                int productId = Convert.ToInt32(array[0]);
                string businessNature = array[1];

                SellerRangeEntity sr = new SellerRangeEntity();
                sr.CompanyId = companyId;
                sr.ProductId = productId;
                sr.Rate = Convert.ToDecimal(1);
                sr.businessNature = businessNature;
                logic.sellerRange.insert(sr);

                rptBind();
                Library.Script.ClientMsg("添加成功!");
            }
        }
Beispiel #4
0
 public static void insert(SellerRangeEntity sr)
 {
     SellerRange.insert(sr);
 }
 protected void rpt_list_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         int srId = Convert.ToInt32(e.CommandArgument);
         string infor;
         logic.sellerRange.delete(srId,logic.sysAdmin.AdminID);
         rptBind();
         infor = "删除成功!";
         Library.Script.ClientMsg(infor);
     }
     else if (e.CommandName == "GO")
     {
         int srId = Convert.ToInt32(e.CommandArgument);
         SellerRangeEntity sr = new SellerRangeEntity();
         sr.SrId = srId;
         sr.IsCancel = false;
         int adminId = logic.sysAdmin.AdminID;
         sr.AdminId = adminId;
         logic.sellerRange.updateCancel(sr);
         rptBind();
         Library.Script.ClientMsg("继续供应成功!");
     }
     else if (e.CommandName == "CancelRange")
     {
         int srId = Convert.ToInt32(e.CommandArgument);
         SellerRangeEntity sr = new SellerRangeEntity();
         sr.SrId = srId;
         sr.IsCancel = true;
         int adminId = logic.sysAdmin.AdminID;
         sr.AdminId = adminId;
         logic.sellerRange.updateCancel(sr);
         rptBind();
         Library.Script.ClientMsg("取消成功!");
     }
 }