protected void FileImageAlbum_FileUploaded(object sender, FileUploadedEventArgs e)
    {
        var FileImageAlbum    = (RadAsyncUpload)sender;
        var Parent            = FileImageAlbum.NamingContainer;
        var ProjectCategoryID = Request.QueryString["PI"];//((HiddenField)Parent.FindControl("hdnProductID")).Value;
        //var RadListView1 = (RadListView)Parent.FindControl("RadListView1");
        //var RadListView2 = (RadListView)Parent.FindControl("RadListView2");

        string targetFolder = "~/res/projectcategory/album/";
        string newName      = Guid.NewGuid().GetHashCode().ToString("X") + e.File.GetExtension();

        e.File.SaveAs(Server.MapPath(targetFolder + newName));

        //ResizeCropImage.ResizeByCondition(targetFolder + newName, 800, 800);
        //ResizeCropImage.CreateThumbNailByCondition("~/res/projectcategory/album/", "~/res/projectcategory/album/thumbs/", newName, 120, 120);

        //if (string.IsNullOrEmpty(ProductID))
        //{
        //    TempImage.Rows.Add(new object[] { newName });

        //    RadListView2.DataSource = TempImage;
        //    RadListView2.DataBind();
        //}
        //else
        //{
        var oProjectCategoryImage = new ProjectCategoryImage();

        oProjectCategoryImage.ProjectCategoryImageInsert(newName, "", "", "", "", "", "", "", ProjectCategoryID, "True", "", "");
        RadListView1.Rebind();
        //}
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!String.IsNullOrEmpty(Request["id"]))
         {
             if (!IsPostBack)
             {
                 RadButton5.Attributes["onclick"] = "OpenAddPro();return false;";                       //添加
                 DeclarationModel            = DeclarationBLL.GetModel(Request["id"].ToString());
                 Label1.Text                 = DeclarationModel.TeacherName;                            //老师
                 Label2.Text                 = DeclarationModel.RepairerName;                           //学生
                 myEditor.InnerText          = DeclarationModel.RepairPlan;                             //故障诊断
                 RadDatePicker1.SelectedDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")); //完修时间
                 Label9.Text                 = "0";
                 if (partsChoice.partsChoiceList.Count <= 5)
                 {
                     RadDataPager1.Visible = false;
                 }
                 else
                 {
                     RadDataPager1.Visible = true;
                 }
             }
         }
         else
         {
             RadAjaxManager1.Redirect("RepairListLS.aspx");
         }
         RadListView1.Rebind();
     }
 }
 protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
 {
     switch (e.Argument)
     {
     case "Rebind":
         RadListView1.DataSource = partsChoice.partsChoiceList.OrderBy(x => x.PartID);
         foreach (var item in partsChoice.partsChoiceList)
         {
             aaa += Convert.ToDecimal(item.Partmoney);
         }
         if (partsChoice.partsChoiceList.Count <= 5)
         {
             RadDataPager1.Visible = false;
         }
         else
         {
             RadDataPager1.Visible = true;
         }
         Label5.Text   = aaa.ToString();
         TextBox1.Text = Convert.ToString(Convert.ToDecimal(Label5.Text) + Convert.ToDecimal(TextBox2.Text));
         Label9.Text   = Convert.ToString(Convert.ToDouble(Convert.ToDecimal(Label5.Text) + Convert.ToDecimal(TextBox2.Text)) * 0.95);
         RadListView1.Rebind();
         break;
     }
 }
Exemple #4
0
    protected void RadSlider1_ValueChanged(object sender, EventArgs e)
    {
        var selectedValue = ((RadSlider)sender).Value;

        if (selectedValue == 1m)
        {
            ImageHeight           = Unit.Pixel(150);
            ImageWidth            = Unit.Pixel(150);
            RadListView1.PageSize = 20;
        }
        else if (selectedValue == 2m)
        {
            ImageHeight           = Unit.Pixel(200);
            ImageWidth            = Unit.Pixel(200);
            RadListView1.PageSize = 10;
        }
        else if (selectedValue == 3m)
        {
            ImageHeight           = Unit.Pixel(350);
            ImageWidth            = Unit.Pixel(350);
            RadListView1.PageSize = 6;
        }

        RadListView1.CurrentPageIndex = 0;
        RadListView1.Rebind();
    }
Exemple #5
0
        protected void rauFiles_FileUploaded(object sender, FileUploadedEventArgs e)
        {
            string filepath = "";

            if (ImgList.Count >= 5)
            {
                RadAjaxManager1.Alert("最多上传5张图!");
                return;
            }
            if (rauFiles.UploadedFiles.Count > 0)
            {
                foreach (UploadedFile file in rauFiles.UploadedFiles)
                {
                    string uploadPath = "/UpLoad/" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + "/";
                    if (!Directory.Exists(uploadPath))
                    {
                        Directory.CreateDirectory(Server.MapPath(uploadPath));
                    }
                    string name = DateTime.Now.ToString("yyyyMMddHHmmssff") + ".png";
                    filepath = Server.MapPath(uploadPath) + name;
                    file.SaveAs(filepath);
                    ImgModel img = new ImgModel();
                    img.ID     = ImgList.Count + 1;
                    img.imgUrl = uploadPath + name;
                    ImgList.Add(img);
                    RadListView1.Rebind();
                }
                //imgPic.ImageUrl = uploadPath + name;
            }
        }
Exemple #6
0
 protected void LinkButton3_Click(object sender, EventArgs e)
 {
     SeachString  = "";
     SeachString1 = ""; //清空查询条件
     select();          //调用方法
     RadListView1.Rebind();
 }
Exemple #7
0
 protected void LinkButton2_Click(object sender, EventArgs e)
 {
     SeachString  = "";
     SeachString1 = ((LinkButton)sender).CommandArgument.ToString();//赋值
     select();
     RadListView1.Rebind();
 }
Exemple #8
0
    protected void FileImageAlbum_FileUploaded(object sender, FileUploadedEventArgs e)
    {
        var FileImageAlbum = (RadAsyncUpload)sender;
        //var Parent = FileImageAlbum.NamingContainer;
        //var ProductID = ((HiddenField)Parent.FindControl("hdnProductID")).Value;
        var ProductOptionCategoryID = string.IsNullOrEmpty(Request.QueryString["poi"]) ? "" : Request.QueryString["poi"];
        //var RadListView1 = (RadListView)Parent.FindControl("RadListView1");
        //var RadListView2 = (RadListView)Parent.FindControl("RadListView2");


        string newName      = Guid.NewGuid().GetHashCode().ToString("X") + e.File.GetExtension();
        string targetFolder = "~/res/productoption/" + newName;

        e.File.SaveAs(Server.MapPath(targetFolder));

        string bgColor = "#ffffff";

        ResizeCropImage.CreateThumbNailWithBackGroundColor("~/res/productoption/", "~/res/productoption/thumbs/", newName, 70, 82, bgColor);
        ResizeCropImage.ResizeWithBackGroundColor(targetFolder, 1000, 1182, bgColor);

        //ResizeCropImage.ResizeByCondition(targetFolder + newName, 800, 800);
        //ResizeCropImage.CreateThumbNailByCondition("~/res/productoption/", "~/res/productoption/thumbs/", newName, 120, 120);

        if (string.IsNullOrEmpty(ProductOptionCategoryID))
        {
            TempImage.Rows.Add(new object[] { newName });

            RadListView2.DataSource = TempImage;
            RadListView2.DataBind();
        }
        else
        {
            var oProductOption = new ProductOption();

            oProductOption.ProductOptionInsert(newName,
                                               "",
                                               "",
                                               "",
                                               "",
                                               "",
                                               "",
                                               "",
                                               "",
                                               "",
                                               "",
                                               "",
                                               "",
                                               "",
                                               ProductOptionCategoryID,
                                               "1",
                                               "0",
                                               "0",
                                               "1",
                                               ""
                                               );
            RadListView1.Rebind();
        }
    }
Exemple #9
0
        protected void RadListView1_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
        {
            string OrderID;

            OrderID = e.CommandArgument.ToString();
            Maticsoft.Model.Users molUsers = Users_Bll.GetModel(UsersInfo.UserID);
            if (e.CommandName == "Pay")
            {
                Response.Write("<script>window.location.href='/ForeManagement/ForeOrdersDetail.aspx?OrderID=" + OrderID + "'</script>");
            }
            if (e.CommandName == "Cancel")
            {
                Maticsoft.Model.Orders molOrders = Orders_Bll.GetModel(OrderID);
                molOrders.OrderState = "订单取消";
                Orders_Bll.Update(molOrders);
            }
            if (e.CommandName == "Hurry")
            {
                Response.Write("<script> alert('催单成功!')</script>");
            }
            if (e.CommandName == "Check")
            {
                Orders_Mol = Orders_Bll.GetModel(OrderID);//引用


                DataSet ds = new DataSet();
                ds        = Orders_Bll.GetList2(0, " a.OrderID='" + OrderID + "' ", " OrderDate");
                Users_Mol = Users_Bll.GetModel(UsersInfo.UserID);//引用
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    //增加销售数量
                    Commodity_Mol = Commodity_Bll.GetModel(dr["CommodityID"].ToString());
                    Commodity_Mol.CommoditySaled = Commodity_Mol.CommoditySaled + Convert.ToInt32(dr["OrderNumber"]);
                    Commodity_Bll.Update(Commodity_Mol);//更新
                    //增加积分点数
                    string str = dr["BuyScore"].ToString();
                    string shu = dr["OrderNumber"].ToString();
                    Users_Mol.UserScore += Convert.ToInt32(str) * Convert.ToInt32(shu);
                }
                Users_Mol.UserGrade   = "VIP";
                Orders_Mol.OrderState = "完成";
                Orders_Bll.Update(Orders_Mol); //更新
                Users_Bll.Update(Users_Mol);   //更新
                RadListView1.Rebind();



                Maticsoft.Model.Orders molOrders = Orders_Bll.GetModel(OrderID);
                //Maticsoft.Model.Commodity molCommodity = Commodity_Bll.GetModel(OrderID);
                //int total = Orders_Bll.GetTotal(OrderID);
                //molUsers.UserScore += total;
                //molOrders.OrderState = "完成";
                Orders_Bll.Update(molOrders);
            }
            if (e.CommandName == "Score")
            {
            }
        }
Exemple #10
0
        protected void RadListView1_ItemCommand(object sender, RadListViewCommandEventArgs e)
        {
            int id = Convert.ToInt32(e.CommandArgument.ToString());

            if (e.CommandName.ToString() == "Delete")
            {
                ImgModel img = new ImgModel();
                img = ImgList.Where(x => x.ID == id).SingleOrDefault();
                ImgList.Remove(img);
                RadListView1.Rebind();
            }
        }
Exemple #11
0
 protected void Linkbtn_delete_all_word_Click(object sender, EventArgs e)
 {
     if (UsersInfo.UserID != "")
     {
         ShoppingCart_Bll.DeleteList2(UsersInfo.UserID);
         RadListView1.Rebind();
         hidden();
     }
     else
     {
         ShoppingCar.ShoppingList.Clear();
         RadListView1.Rebind();
         hidden();
     }
 }
Exemple #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    Maticsoft.Model.Replacement molr = bllr.GetModel(Request.QueryString["ID"].ToString());//引用id所在行的数据
                    if (molr == null)
                    {
                        Response.Write("<script>window.location.href='~/BackLogin.aspx'</script>");
                    }

                    Maticsoft.Model.MachineFatherType molmf = bllmf.GetModel(molr.MachineFatherID);
                    Maticsoft.Model.MachineSonType    molms = bllms.GetModel(molr.MachineSonID);

                    Label1.Text = molr.ReplacementID;
                    Label2.Text = molr.ReplacementModel;
                    Label3.Text = molr.ReplacementName;
                    Label4.Text = molmf.MachineFatherName + "-" + molms.MachineSonName;
                    Label5.Text = molr.ReplacementState;
                    Label6.Text = molr.ReplacementAddTime.ToString();

                    string st = molr.ReplacementPicture;

                    string[] sop = st.Split(';');

                    ImgList.Clear();

                    for (int i = 0; i < sop.Length - 1; i++)
                    {
                        ImgModel img = new ImgModel();
                        img.ID     = ImgList.Count + 1;
                        img.imgUrl = sop[i];
                        ImgList.Add(img);
                        RadListView1.Rebind();
                    }
                }
            }
        }
Exemple #13
0
        protected void RadListView1_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
        {
            string ShoppingCartID1;

            ShoppingCartID1 = e.CommandArgument.ToString();
            Telerik.Web.UI.RadNumericTextBox Commoditynum      = e.ListViewItem.FindControl("Commoditynum") as Telerik.Web.UI.RadNumericTextBox;
            Maticsoft.Model.ShoppingCart     modelShoppingCart = ShoppingCart_Bll.GetModel(ShoppingCartID1);
            Maticsoft.Model.Users            modelUsers        = Users_Bll.GetModel(UsersInfo.UserID);
            if (e.CommandName == "Delete")
            {
                if (UsersInfo.UserID != "")
                {
                    ShoppingCart_Bll.DeleteList(e.CommandArgument.ToString());
                    RadListView1.Rebind();//删除
                    if (ShoppingCart_Bll.GetRecordCount3("a.CommodityID = b.CommodityID and a.UserID='" + UsersInfo.UserID + "'") == 0)
                    {
                        content_buy.Visible = false;
                    }
                }
                else
                {
                    string       id = e.CommandArgument.ToString();
                    ShoppingItem si = new ShoppingItem();
                    si = ShoppingCar.ShoppingList.Where(x => x.CommodityID == id).SingleOrDefault();

                    ShoppingCar.ShoppingList.Remove(ShoppingCar.ShoppingList.Where(x => x.ShoppingCartID == id).SingleOrDefault());
                    ShoppingItem jsnum  = new ShoppingItem();
                    decimal      zongji = 0;
                    foreach (var item in ShoppingCar.ShoppingList)
                    {
                        zongji += item.Subtotal;
                        Lbl_totalprice.Text = zongji.ToString();
                    }
                    hidden();
                    RadListView1.Rebind();//刷新
                }
            }
            if (e.CommandName == "Add")
            {
                string CommodityID1;
                CommodityID1 = e.CommandArgument.ToString();
                Maticsoft.Model.Commodity modelCommodity = Commodity_Bll.GetModel(CommodityID1);
                num = Convert.ToInt32(Commoditynum.Text);
                if (num < Convert.ToInt32(modelCommodity.Stock))
                {
                    num++;
                    Commoditynum.Text = num.ToString();
                }
                else
                {
                    Commoditynum.Text = num.ToString();
                }
                if (UsersInfo.UserID != "")
                {
                    string CommodityID2;
                    CommodityID2 = e.CommandArgument.ToString();

                    string ShoppingCartID2 = ShoppingCart_Bll.GetList(" CommodityID='" + CommodityID2 + "' and UserID='" + UsersInfo.UserID + "' ").Tables[0].Rows[0]["ShoppingCartID"].ToString();
                    Maticsoft.Model.Commodity modelCommodity2 = Commodity_Bll.GetModel(CommodityID2);
                    modelCommodity2 = Commodity_Bll.GetModel(CommodityID2);
                    modelUsers      = Users_Bll.GetModel(UsersInfo.UserID);
                    decimal discount1;
                    if (modelUsers.UserGrade == "VIP")
                    {
                        discount1 = Convert.ToDecimal(0.95);
                    }
                    else
                    {
                        discount1 = Convert.ToDecimal(1);
                    }
                    modelShoppingCart             = ShoppingCart_Bll.GetModel(ShoppingCartID2);                                                              //获取id所在行数据
                    modelShoppingCart.OrderNumber = Convert.ToInt32(Commoditynum.Text);                                                                      //商品数量
                    modelShoppingCart.Subtotal    = (Convert.ToInt32(Commoditynum.Text) * Convert.ToInt32(modelCommodity2.VIPPrice) * discount1).ToString(); //商品小计
                    ShoppingCart_Bll.Update(modelShoppingCart);
                    RadListView1.Rebind();
                }
                else
                {
                    string CommodityID3;
                    CommodityID3 = e.CommandArgument.ToString();
                    ShoppingItem si = new ShoppingItem();
                    si            = ShoppingCar.ShoppingList.Where(x => x.CommodityID == CommodityID3).First();
                    Commodity_Mol = Commodity_Bll.GetModel(si.CommodityID);
                    if (si.OrderNumber + 1 <= Commodity_Mol.Stock)
                    {
                        int num1 = si.OrderNumber + 1;
                        si.OrderNumber = num1;
                        Decimal b = num * Convert.ToDecimal(Commodity_Mol.VIPPrice) * 1;
                        si.Subtotal = b;
                        ShoppingCar.ShoppingList.Remove(ShoppingCar.ShoppingList.Where(x => x.CommodityID == CommodityID3).SingleOrDefault());
                        ShoppingCar.ShoppingList.Add(si);
                        ShoppingItem jsnum  = new ShoppingItem();
                        decimal      zongji = 0;
                        foreach (var item in ShoppingCar.ShoppingList)
                        {
                            zongji += item.Subtotal;
                            Lbl_totalprice.Text = zongji.ToString();
                        }
                        RadListView1.Rebind();
                    }
                    else
                    {
                        RadAjaxManager1.Alert("已经最大了");
                    }
                }
            }
            if (e.CommandName == "Jian")
            {
                num = Convert.ToInt32(Commoditynum.Text);
                if (num <= 0)
                {
                    num = 1;
                }
                else
                {
                    num--;
                }
                Commoditynum.Text = num.ToString();

                if (UsersInfo.UserID != "")
                {
                    string CommodityID2;
                    CommodityID2 = e.CommandArgument.ToString();
                    string ShoppingCartID2 = ShoppingCart_Bll.GetList(" CommodityID='" + CommodityID2 + "' and UserID='" + UsersInfo.UserID + "' ").Tables[0].Rows[0]["ShoppingCartID"].ToString();
                    Maticsoft.Model.Commodity modelCommodity2 = Commodity_Bll.GetModel(CommodityID2);
                    modelCommodity2 = Commodity_Bll.GetModel(CommodityID2);
                    modelUsers      = Users_Bll.GetModel(UsersInfo.UserID);
                    decimal discount1;
                    if (modelUsers.UserGrade == "VIP")
                    {
                        discount1 = Convert.ToDecimal(0.95);
                    }
                    else
                    {
                        discount1 = Convert.ToDecimal(1);
                    }
                    modelShoppingCart             = ShoppingCart_Bll.GetModel(ShoppingCartID2);                                                              //获取id所在行数据
                    modelShoppingCart.OrderNumber = Convert.ToInt32(Commoditynum.Text);                                                                      //商品数量
                    modelShoppingCart.Subtotal    = (Convert.ToInt32(Commoditynum.Text) * Convert.ToInt32(modelCommodity2.VIPPrice) * discount1).ToString(); //商品小计
                    ShoppingCart_Bll.Update(modelShoppingCart);
                    RadListView1.Rebind();
                }
                else
                {
                    string       id = e.CommandArgument.ToString();
                    ShoppingItem si = new ShoppingItem();
                    si = ShoppingCar.ShoppingList.Where(x => x.CommodityID == id).First();
                    if (si.OrderNumber > 1)
                    {
                        int num1 = si.OrderNumber - 1;
                        si.OrderNumber = num1;
                        Commodity_Mol  = Commodity_Bll.GetModel(si.CommodityID);
                        Decimal b = num * Convert.ToDecimal(Commodity_Mol.VIPPrice) * 1;
                        si.Subtotal = b;
                        ShoppingCar.ShoppingList.Remove(ShoppingCar.ShoppingList.Where(x => x.CommodityID == id).SingleOrDefault());
                        ShoppingCar.ShoppingList.Add(si);
                        ShoppingItem jsnum  = new ShoppingItem();
                        decimal      zongji = 0;
                        foreach (var item in ShoppingCar.ShoppingList)
                        {
                            zongji += item.Subtotal;
                            Lbl_totalprice.Text = zongji.ToString();
                        }
                        RadListView1.Rebind();
                    }
                    else
                    {
                        RadAjaxManager1.Alert("已经最小了");
                    }
                }
            }
        }
Exemple #14
0
    protected void RadListView1_ItemCommand(object sender, RadListViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName == "PerformInsert")
            {
                var item          = e.ListViewItem;
                var FileImageName = (RadUpload)item.FindControl("FileImageName");

                var strProductName          = ((Label)FormView1.FindControl("lblProductName")).Text.Trim();
                var strConvertedProductName = Common.ConvertTitle(strProductName);
                var strImageName            = FileImageName.UploadedFiles.Count > 0 ? Guid.NewGuid().GetHashCode().ToString("X") + FileImageName.UploadedFiles[0].GetExtension() : "";
                var strTitle         = ((TextBox)item.FindControl("txtTitle")).Text.Trim();
                var strDescription   = ((TextBox)item.FindControl("txtDescription")).Text.Trim();
                var strTitleEn       = ((TextBox)item.FindControl("txtTitleEn")).Text.Trim();
                var strDescriptionEn = ((TextBox)item.FindControl("txtDescriptionEn")).Text.Trim();
                var IsAvailable      = ((CheckBox)item.FindControl("chkAddIsAvailable")).Checked.ToString();
                var Priority         = ((RadNumericTextBox)item.FindControl("txtPriority")).Text.Trim();
                var oProductImage    = new ProductImage();

                oProductImage.ProductImageInsert(
                    strImageName,
                    strConvertedProductName,
                    strTitle,
                    strDescription,
                    strTitleEn,
                    strDescriptionEn,
                    Request.QueryString["PI"],
                    IsAvailable,
                    Priority);

                string strFullPath = "~/res/product/album/" + strImageName;

                if (!string.IsNullOrEmpty(strImageName))
                {
                    FileImageName.UploadedFiles[0].SaveAs(Server.MapPath(strFullPath));
                    ResizeCropImage.ResizeByCondition(strFullPath, 700, 445);
                    ResizeCropImage.CreateThumbNailByCondition("~/res/product/album/", "~/res/product/album/thumbs/", strImageName, 120, 120);
                }
                RadListView1.InsertItemPosition = RadListViewInsertItemPosition.None;
            }
            else if (e.CommandName == "Update")
            {
                var item          = e.ListViewItem;
                var FileImageName = (RadUpload)item.FindControl("FileImageName");
                var dsUpdateParam = ObjectDataSource1.UpdateParameters;

                var strProductImageID       = ((HiddenField)e.ListViewItem.FindControl("hdnProductImageID")).Value;
                var strProductName          = ((Label)FormView1.FindControl("lblProductName")).Text.Trim();
                var strConvertedProductName = Common.ConvertTitle(strProductName);
                var strOldImageName         = ((HiddenField)e.ListViewItem.FindControl("hdnImageName")).Value;
                var strIsAvailable          = ((CheckBox)item.FindControl("chkAddIsAvailable")).Checked.ToString();
                var strImageName            = FileImageName.UploadedFiles.Count > 0 ? Guid.NewGuid().GetHashCode().ToString("X") + FileImageName.UploadedFiles[0].GetExtension() : "";

                dsUpdateParam["ImageName"].DefaultValue            = !string.IsNullOrEmpty(strImageName) ? strImageName : strOldImageName;
                dsUpdateParam["ConvertedProductName"].DefaultValue = strConvertedProductName;
                dsUpdateParam["IsAvailable"].DefaultValue          = strIsAvailable;

                if (!string.IsNullOrEmpty(strImageName))
                {
                    var strOldImagePath      = Server.MapPath("~/res/product/album/" + strOldImageName);
                    var strOldThumbImagePath = Server.MapPath("~/res/product/album/thumbs/" + strOldImageName);

                    if (File.Exists(strOldImagePath))
                    {
                        File.Delete(strOldImagePath);
                    }
                    if (File.Exists(strOldThumbImagePath))
                    {
                        File.Delete(strOldThumbImagePath);
                    }

                    strImageName = (string.IsNullOrEmpty(strConvertedProductName) ? "" : strConvertedProductName + "-") + strProductImageID + strImageName.Substring(strImageName.LastIndexOf('.'));
                    string strFullPath = "~/res/product/album/" + strImageName;

                    FileImageName.UploadedFiles[0].SaveAs(Server.MapPath(strFullPath));
                    ResizeCropImage.ResizeByCondition(strFullPath, 700, 445);
                    ResizeCropImage.CreateThumbNailByCondition("~/res/product/album/", "~/res/product/album/thumbs/", strImageName, 120, 120);
                }
            }
            else if (e.CommandName == "Delete")
            {
                var strOldImageName = ((HiddenField)e.ListViewItem.FindControl("hdnImageName")).Value;
                DeleteImage(strOldImageName);
            }
            else if (e.CommandName == "QuickUpdate")
            {
                string ProductImageID, Priority, IsAvailable;
                var    oProductImage = new ProductImage();

                foreach (RadListViewDataItem item in RadListView1.Items)
                {
                    ProductImageID = item.GetDataKeyValue("ProductImageID").ToString();
                    Priority       = ((RadNumericTextBox)item.FindControl("txtPriority")).Text.Trim();
                    IsAvailable    = ((CheckBox)item.FindControl("chkIsAvailable")).Checked.ToString();

                    oProductImage.ProductImageQuickUpdate(
                        ProductImageID,
                        IsAvailable,
                        Priority
                        );
                }
            }
            else if (e.CommandName == "DeleteSelected")
            {
                var    oProductImage = new ProductImage();
                string ProductImageID, OldImageName;

                foreach (RadListViewDataItem item in RadListView1.Items)
                {
                    var chkSelect = (CheckBox)item.FindControl("chkSelect");

                    if (chkSelect.Checked)
                    {
                        ProductImageID = item.GetDataKeyValue("ProductImageID").ToString();
                        OldImageName   = ((HiddenField)item.FindControl("hdnImageName")).Value;

                        DeleteImage(OldImageName);
                        oProductImage.ProductImageDelete(ProductImageID);
                    }
                }
            }
            RadListView1.Rebind();
        }
        catch (Exception ex)
        {
            lblError.Text = ex.Message;
        }
    }
        protected void RadListView1_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
        {
            partsCost si = new partsCost();//list赋值

            if (e.CommandName == "Delete")
            {
                string i = e.CommandArgument.ToString();
                si = partsChoice.partsChoiceList.Where(x => x.PartPutRecordID == i).SingleOrDefault();
                partsChoice.partsChoiceList.Remove(partsChoice.partsChoiceList.Where(x => x.PartPutRecordID == i).SingleOrDefault());//删值
                //if (ShoppingCar.ShoppingList.Count() < 5)
                //{
                //    RadDataPager1.Visible = false;
                //}
                //else
                //{
                //    RadDataPager1.Visible = true;
                //}
                if (partsChoice.partsChoiceList.Count <= 5)
                {
                    RadDataPager1.Visible = false;
                }
                else
                {
                    RadDataPager1.Visible = true;
                }
                RadListView1.Rebind();//刷新
            }
            if (e.CommandName == "add")
            {
                string id = e.CommandArgument.ToString();
                si = partsChoice.partsChoiceList.Where(x => x.PartPutRecordID == id).SingleOrDefault(); //找到数据
                //CommodityModel = CommodityBLL.GetModel(si.GoodsID);
                if (Convert.ToInt32(si.PartUseNumber) + 1 <= Convert.ToInt32(si.PartPutNumber))         //数量+1是否超过库存
                {
                    int a = Convert.ToInt32(si.PartUseNumber) + 1;
                    si.PartUseNumber = a.ToString();                                                                                       //赋值
                    si.Partmoney     = Convert.ToString(Convert.ToDecimal(si.PartPrice) * Convert.ToDecimal(si.PartUseNumber));
                    partsChoice.partsChoiceList.Remove(partsChoice.partsChoiceList.Where(x => x.PartPutRecordID == id).SingleOrDefault()); //删除
                    partsChoice.partsChoiceList.Add(si);                                                                                   //添加
                    RadListView1.Rebind();                                                                                                 //刷新
                }
                else
                {
                    RadAjaxManager1.Alert("已经最大了");
                }
            }
            if (e.CommandName == "jian")
            {
                string id = e.CommandArgument.ToString();
                si = partsChoice.partsChoiceList.Where(x => x.PartPutRecordID == id).SingleOrDefault();
                //CommodityModel = CommodityBLL.GetModel(si.GoodsID);
                if (Convert.ToInt32(si.PartUseNumber) - 1 > 0)
                {
                    int a = Convert.ToInt32(si.PartUseNumber) - 1;
                    si.PartUseNumber = a.ToString();
                    si.Partmoney     = Convert.ToString(Convert.ToDecimal(si.PartPrice) * Convert.ToDecimal(si.PartUseNumber));
                    partsChoice.partsChoiceList.Remove(partsChoice.partsChoiceList.Where(x => x.PartPutRecordID == id).SingleOrDefault());
                    partsChoice.partsChoiceList.Add(si);
                    RadListView1.Rebind();
                }
                else
                {
                    RadAjaxManager1.Alert("已经最小的");
                }
            }
        }
Exemple #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    Maticsoft.Model.Replacement molr = bllr.GetModel(Request.QueryString["ID"].ToString());//引用id所在行的数据

                    if (molr.ReplacementState == "已借出")
                    {
                        Response.Write("<script>alert('已借出,无法修改!');window.location.href='SubstituteMachine.aspx'</script>");
                        return;
                    }
                    if (molr.ReplacementState == "已报废")
                    {
                        Response.Write("<script>alert('已报废,无法修改!');window.location.href='SubstituteMachine.aspx'</script>");
                        return;
                    }

                    if (molr == null)
                    {
                        Response.Write("<script>window.location.href='~/BackLogin.aspx'</script>");
                    }

                    MachineFather.Items.Clear();
                    MachineSon.Items.Clear();
                    MachineFather.Items.Add("请选择...");
                    MachineSon.Items.Add("请选择...");

                    MachineFather.DataSource     = bllmf.GetList("");
                    MachineFather.DataTextField  = "MachineFatherName";
                    MachineFather.DataValueField = "MachineFatherID";
                    MachineFather.DataBind();

                    MachineSon.DataSource     = bllms.GetList(" MachineFatherID ='" + MachineFather.SelectedValue + "'  ");
                    MachineSon.DataTextField  = "MachineSonName";
                    MachineSon.DataValueField = "MachineSonID";
                    MachineSon.DataBind();

                    Maticsoft.Model.MachineFatherType molmf = bllmf.GetModel(molr.MachineFatherID);
                    Maticsoft.Model.MachineSonType    molms = bllms.GetModel(molr.MachineSonID);

                    ReplacementName.Text        = molr.ReplacementName;
                    ReplacementModel.Text       = molr.ReplacementModel;
                    MachineFather.SelectedValue = molmf.MachineFatherID;

                    MachineSon.Items.Clear();       //清子类下拉框项目
                    MachineSon.Items.Add("请选择..."); //给市下拉框添加请选择
                    MachineSon.DataSource     = bllms.GetList(" MachineFatherID ='" + MachineFather.SelectedValue + "'  ");
                    MachineSon.DataTextField  = "MachineSonName";
                    MachineSon.DataValueField = "MachineSonID";
                    MachineSon.DataBind();

                    MachineSon.SelectedValue = molms.MachineSonID;
                    //DropDownList1.SelectedValue = molr.ReplacementState;

                    string st = molr.ReplacementPicture;

                    string[] sop = st.Split(';');

                    ImgList.Clear();

                    for (int i = 0; i < sop.Length - 1; i++)        //修改图片显示
                    {
                        ImgModel img = new ImgModel();
                        img.ID     = ImgList.Count + 1;
                        img.imgUrl = sop[i];
                        ImgList.Add(img);
                        RadListView1.Rebind();
                    }

                    //imgPic.ImageUrl = molr.ReplacementPicture;
                }
            }
        }
Exemple #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    Maticsoft.Model.Declaration modelDeclaration = Declaration_Bll.GetModel(Request.QueryString["ID"].ToString());; //引用id所在行的数据

                    DDMachineFather.Items.Clear();
                    DDMachineSon.Items.Clear();
                    DDMachineFather.Items.Add("请选择");
                    DDMachineSon.Items.Add("请选择");

                    DDMachineFather.DataSource     = MachineFather_Bll.GetList("");
                    DDMachineFather.DataTextField  = "MachineFatherName";
                    DDMachineFather.DataValueField = "MachineFatherID";
                    DDMachineFather.DataBind();
                    DDMachineFather.SelectedValue = modelDeclaration.MachineFatherType;

                    DDMachineSon.DataSource     = MachineSon_Bll.GetList(" MachineFatherID ='" + DDMachineFather.SelectedValue + "'  ");
                    DDMachineSon.DataTextField  = "MachineSonName";
                    DDMachineSon.DataValueField = "MachineSonID";
                    DDMachineSon.DataBind();
                    DDMachineSon.SelectedValue = modelDeclaration.MachineSonType;

                    TextBox1.Text = modelDeclaration.MachineName; //添加数据
                    TextBox2.Text = modelDeclaration.AssetsID;    //添加数据
                    TextBox3.Text = modelDeclaration.Model;
                    if (modelDeclaration.OtherPart != "")
                    {
                        aDown.Visible = true;
                        aDown.HRef    = modelDeclaration.OtherPart;//添加数据
                    }
                    if (modelDeclaration.ReplacementUse == "是")
                    {
                        RadioButton1.Checked = true;
                    }
                    else
                    {
                        RadioButton2.Checked = true;
                    }
                    //DDUnitName.DataSource = UnitsInfo_Bll.GetList("");
                    //DDUnitName.DataTextField = "UnitName";
                    //DDUnitName.DataValueField = "UnitID";
                    //DDUnitName.DataBind();
                    //DDUnitName.SelectedItem.Text = modelDeclaration.UnitName;
                    TextBox5.Text = modelDeclaration.Contact;
                    TextBox6.Text = modelDeclaration.ContactPhone;
                    if (modelDeclaration.DoorServer == "是")
                    {
                        RadioButton3.Checked = true;
                    }
                    else
                    {
                        RadioButton4.Checked = true;
                    }
                    myEditor.Value = modelDeclaration.BreakDown;


                    string st = modelDeclaration.CCC5;

                    string[] sop = st.Split(';');

                    ImgList.Clear();

                    for (int i = 0; i < sop.Length - 1; i++)        //修改图片显示
                    {
                        ImgModel img = new ImgModel();
                        img.ID     = ImgList.Count + 1;
                        img.imgUrl = sop[i];
                        ImgList.Add(img);
                        RadListView1.Rebind();
                    }
                }
                else
                {
                    Response.Redirect("RepairBX.aspx");
                }
            }
        }
Exemple #18
0
    protected void RadListView1_ItemCommand(object sender, RadListViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName == "PerformInsert" || e.CommandName == "Update")
            {
                var item          = e.ListViewItem;
                var FileImagePath = (RadUpload)item.FindControl("FileImagePath");
                var FileVideoPath = (RadUpload)item.FindControl("FileVideoPath");

                string strProjectVideoID;
                var    strProjectID             = Request.QueryString["PI"];
                var    strProjectTitle          = ((Label)FormView1.FindControl("lblProjectTitle")).Text.Trim();
                var    strConvertedProjectTitle = Common.ConvertTitle(strProjectTitle);
                var    strImagePath             = FileImagePath.UploadedFiles.Count > 0 ? FileImagePath.UploadedFiles[0].GetName() : "";
                var    strVideoPath             = FileVideoPath.UploadedFiles.Count > 0 ? FileVideoPath.UploadedFiles[0].GetName() : "";
                var    strTitle         = ((TextBox)item.FindControl("txtTitle")).Text.Trim();
                var    strDescription   = ((TextBox)item.FindControl("txtDescription")).Text.Trim();
                var    strTitleEn       = ((TextBox)item.FindControl("txtTitleEn")).Text.Trim();
                var    strDescriptionEn = ((TextBox)item.FindControl("txtDescriptionEn")).Text.Trim();
                var    strIsAvailable   = ((CheckBox)item.FindControl("chkIsAvailable")).Checked.ToString();
                var    strPriority      = ((RadNumericTextBox)item.FindControl("txtPriority")).Text.Trim();
                var    oProjectVideo    = new ProjectVideo();

                if (e.CommandName == "PerformInsert")
                {
                    strProjectVideoID = oProjectVideo.ProjectVideoInsert(
                        strTitle,
                        strDescription,
                        strTitleEn,
                        strDescriptionEn,
                        strConvertedProjectTitle,
                        strImagePath,
                        strVideoPath,
                        strProjectID,
                        strIsAvailable,
                        strPriority).ToString();
                    RadListView1.InsertItemPosition = RadListViewInsertItemPosition.None;
                }
                else
                {
                    strProjectVideoID = ((HiddenField)item.FindControl("hdnProjectVideoID")).Value;
                    var strOldImagePath = ((HiddenField)item.FindControl("hdnImagePath")).Value;
                    var strOldVideoPath = ((HiddenField)item.FindControl("hdnProjectVideoPath")).Value;
                    var dsUpdateParam   = ObjectDataSource1.UpdateParameters;

                    if (!string.IsNullOrEmpty(strVideoPath))
                    {
                        strOldVideoPath = Server.MapPath("~/res/project/video/" + strOldVideoPath);
                        if (File.Exists(strOldVideoPath))
                        {
                            File.Delete(strOldVideoPath);
                        }
                    }
                    if (!string.IsNullOrEmpty(strImagePath))
                    {
                        strOldImagePath = Server.MapPath("~/res/project/video/thumbs/" + strOldImagePath);
                        if (File.Exists(strOldImagePath))
                        {
                            File.Delete(strOldImagePath);
                        }
                    }

                    dsUpdateParam["ImagePath"].DefaultValue        = strImagePath;
                    dsUpdateParam["ProjectVideoPath"].DefaultValue = strVideoPath;
                    dsUpdateParam["ConvertedTitle"].DefaultValue   = strConvertedProjectTitle;
                }


                string strFullVideoPath = "~/res/project/video/" + (string.IsNullOrEmpty(strConvertedProjectTitle) ? "" : strConvertedProjectTitle + "-") + strProjectVideoID + Path.GetExtension(strVideoPath);
                string strFullImagePath = "~/res/project/video/thumbs/" + (string.IsNullOrEmpty(strConvertedProjectTitle) ? "" : strConvertedProjectTitle + "-") + strProjectVideoID + Path.GetExtension(strImagePath);

                if (!string.IsNullOrEmpty(strVideoPath))
                {
                    FileVideoPath.UploadedFiles[0].SaveAs(Server.MapPath(strFullVideoPath));
                }
                if (!string.IsNullOrEmpty(strImagePath))
                {
                    FileImagePath.UploadedFiles[0].SaveAs(Server.MapPath(strFullImagePath));
                    ResizeCropImage.ResizeByCondition(strFullImagePath, 600, 600);
                }
            }
            else if (e.CommandName == "Delete")
            {
                var strOldImagePath = ((HiddenField)e.ListViewItem.FindControl("hdnImagePath")).Value;
                DeleteImage(strOldImagePath);
            }
            else if (e.CommandName == "QuickUpdate")
            {
                string ProjectVideoID, Priority, IsAvailable;
                var    oProjectVideo = new ProjectVideo();

                foreach (RadListViewDataItem item in RadListView1.Items)
                {
                    ProjectVideoID = item.GetDataKeyValue("ProjectVideoID").ToString();
                    Priority       = ((RadNumericTextBox)item.FindControl("txtPriority")).Text.Trim();
                    IsAvailable    = ((CheckBox)item.FindControl("chkIsAvailable")).Checked.ToString();

                    oProjectVideo.ProjectVideoQuickUpdate(
                        ProjectVideoID,
                        IsAvailable,
                        Priority
                        );
                }
            }
            else if (e.CommandName == "DeleteSelected")
            {
                var    oProjectVideo = new ProjectVideo();
                string ProjectVideoID, OldImagePath, OldVideoPath;

                foreach (RadListViewDataItem item in RadListView1.Items)
                {
                    var chkSelect = (CheckBox)item.FindControl("chkSelect");

                    if (chkSelect.Checked)
                    {
                        ProjectVideoID = item.GetDataKeyValue("ProjectVideoID").ToString();
                        OldImagePath   = ((HiddenField)item.FindControl("hdnImagePath")).Value;
                        OldVideoPath   = ((HiddenField)item.FindControl("hdnVideoPath")).Value;

                        DeleteImage(OldImagePath);
                        DeleteVideo(OldVideoPath);
                        oProjectVideo.ProjectVideoDelete(ProjectVideoID);
                    }
                }
            }
            RadListView1.Rebind();
        }
        catch (Exception ex)
        {
            lblError.Text = ex.Message;
        }
    }
Exemple #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    Maticsoft.Model.Declaration modelDeclaration = Declaration_Bll.GetModel(Request.QueryString["ID"].ToString());; //引用id所在行的数据
                    if (modelDeclaration.ReplacementID != "")
                    {
                        Label4.Text           = modelDeclaration.ReplacementID;
                        ReplacementID.Visible = true;
                    }
                    else
                    {
                        ReplacementID.Visible = false;
                    }
                    Label14.Text = MachineFather_Bll.GetModel(modelDeclaration.MachineFatherType).MachineFatherName;
                    Label1.Text  = modelDeclaration.MachineName; //添加数据
                    Label2.Text  = modelDeclaration.AssetsID;    //添加数据
                    Label3.Text  = modelDeclaration.Model;       //添加数据
                    if (modelDeclaration.OtherPart != "")
                    {
                        aDown.HRef = modelDeclaration.OtherPart;//添加数据
                    }
                    else
                    {
                        aDown.InnerText = "暂无";
                    }
                    if (modelDeclaration.ReplacementUse == "是")
                    {
                        Label6.Text = "是";
                    }
                    else
                    {
                        Label6.Text = "否";
                    }
                    Label7.Text  = modelDeclaration.UnitName;
                    Label8.Text  = modelDeclaration.RepairTime.ToString();
                    Label9.Text  = modelDeclaration.Contact;
                    Label10.Text = modelDeclaration.ContactPhone;
                    if (modelDeclaration.DoorServer == "是")
                    {
                        Label11.Text = "是";
                    }
                    else
                    {
                        Label11.Text = "否";
                    }
                    if (modelDeclaration.RepairerName == "")
                    {
                        RepairID.Visible = false;
                    }
                    else
                    {
                        Label12.Text = modelDeclaration.RepairerName;
                    }
                    Label13.Text = modelDeclaration.DeclarationState;
                    Label5.Text  = modelDeclaration.BreakDown;
                    string st = modelDeclaration.CCC5;

                    string[] sop = st.Split(';');

                    ImgList.Clear();

                    for (int i = 0; i < sop.Length - 1; i++)
                    {
                        ImgModel img = new ImgModel();
                        img.ID     = ImgList.Count + 1;
                        img.imgUrl = sop[i];
                        ImgList.Add(img);
                        RadListView1.Rebind();
                    }
                }
                else
                {
                    Response.Redirect("RepairBX.aspx");
                }
            }
        }
Exemple #20
0
 protected void RadComboBoxCategories_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
 {
     RadListView1.Rebind();
 }
Exemple #21
0
        protected void Linkbtn_buyall_word_Click(object sender, EventArgs e)
        {
            Maticsoft.Model.Users       modelUsers       = Users_Bll.GetModel(UsersInfo.UserID);
            Maticsoft.Model.Orders      modelOrders      = new Maticsoft.Model.Orders();
            Maticsoft.Model.OrderDetail modelOrderDetail = new Maticsoft.Model.OrderDetail();

            if (UsersInfo.UserID != "")
            {
                DataSet dsbasket = new DataSet();
                dsbasket = ShoppingCart_Bll.GetList(" UserID ='" + UsersInfo.UserID + "' ");
                foreach (DataRow drbasket in dsbasket.Tables[0].Rows)
                {
                    Commodity_Mol = Commodity_Bll.GetModel(drbasket["CommodityID"].ToString());
                    if (Convert.ToInt32(drbasket["OrderNumber"]) >= Commodity_Mol.Stock)
                    {
                        RadAjaxManager1.Alert("库存不足!");
                        return;
                    }
                }

                if (modelUsers.UserRealName == "" && modelUsers.Address1 == "")
                {
                    Response.Write("<script> alert('请完善个人信息!'); window.location.href='ForeVIP.aspx' </script>");
                }
                else
                {
                    modelOrders.OrderID = DateTime.Now.ToString("yyyyMMddHHmmss");   //订单号

                    modelOrders.UserID     = UsersInfo.UserID;                       //用户ID
                    modelOrders.OrderDate  = DateTime.Now;                           //下单时间
                    modelOrders.OrderState = "待付款";
                    modelOrders.TotalMoney = Convert.ToDecimal(Lbl_totalprice.Text); //总金额

                    modelOrders.AddresseeName    = modelUsers.UserRealName;
                    modelOrders.AddresseePhone   = modelUsers.Phone;
                    modelOrders.AddresseeAddress = modelUsers.Province + modelUsers.City + modelUsers.Address1;

                    Orders_Bll.Add(modelOrders); //订单表

                    DataSet ds = new DataSet();
                    ds = ShoppingCart_Bll.GetList(" UserID='" + UsersInfo.UserID + "' ");
                    string id = DateTime.Now.ToString("yyyyMMddHHmmss");
                    int    i  = 0;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        i++;
                        modelOrderDetail.OrderDetailID = id + i.ToString();
                        modelOrderDetail.OrderID       = modelOrders.OrderID;
                        modelOrderDetail.UserID        = UsersInfo.UserID;
                        modelOrderDetail.CommodityID   = dr["CommodityID"].ToString();
                        modelOrderDetail.OrderNumber   = Convert.ToInt32(dr["OrderNumber"]);
                        modelOrderDetail.Subtotal      = dr["Subtotal"].ToString();
                        OrderDetail_Bll.Add(modelOrderDetail);
                        Commodity_Mol = Commodity_Bll.GetModel(dr["CommodityID"].ToString());
                        if (ShoppingCart_Mol.OrderNumber > Commodity_Mol.Stock)
                        {
                            RadAjaxManager1.Alert("库存不足!");
                            return;
                        }
                        Commodity_Mol.Stock = Commodity_Mol.Stock - Convert.ToInt32(dr["OrderNumber"]);


                        if (Commodity_Mol.Stock <= 0)
                        {
                            Commodity_Mol.CommodityState = "下架";
                        }

                        Commodity_Bll.Update(Commodity_Mol);
                    }



                    ShoppingCart_Bll.DeleteList2(UsersInfo.UserID);
                    hidden();
                    RadListView1.Rebind();
                    Response.Write("<script> alert('下单成功!'); window.location.href='ForeOrdersDetail.aspx?OrderID=" + modelOrders.OrderID + "' </script>");
                }
            }
            else
            {
                Response.Write("<script> alert('请先登陆!'); window.location.href='/Login.aspx' </script>");
            }
        }
Exemple #22
0
 protected void RadListView1_PageIndexChanged(object sender, Telerik.Web.UI.RadListViewPageChangedEventArgs e)
 {
     select();
     RadListView1.Rebind();
 }