コード例 #1
0
ファイル: PartsTypeEdit.aspx.cs プロジェクト: Jyf524/Repair
 protected void Page_Load(object sender, EventArgs e)
 {
     if (UsersInfo.UserID == "" || UsersInfo.UserRole != "维修中心管理员")
     {
         UsersInfo.UserID   = "";
         UsersInfo.UserName = "";
         UsersInfo.UserRole = "";
         Response.Redirect("~/BackLogin.aspx");
         return;
     }
     btnback.Attributes["onclick"] = "GetClose();return false;";
     if (!IsPostBack)
     {
         if (Request.QueryString["ID"] == null)
         {
             RadAjaxManager1.Alert("请选择一条数据!");
             Response.Write("<script>window.location.href='PartsType.aspx'</script>");
             return;
         }
         modelparttype = bllPartType.GetModel(Request.QueryString["ID"].ToString());
         if (modelparttype == null)
         {
             RadAjaxManager1.Alert("请选择一条数据!");
             ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CloseAndRebind();</script>");
             return;
         }
         PartTypeName.Text = modelparttype.PartTypeName;
     }
 }
コード例 #2
0
ファイル: RepairAdd.aspx.cs プロジェクト: Jyf524/Repair
        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;
            }
        }
コード例 #3
0
    protected void btnAccept_Click(object sender, ImageClickEventArgs e)
    {
        string command = "";
        bool   nuevo   = false;

        if (pat == null)
        {
            command = "CloseAndRebind('new')";
            nuevo   = true;
        }
        else
        {
            command = "CloseAndRebind('')";
        }
        if (!CreateChange())
        {
            return;
        }
        if (type == "InTab")
        {
            RadAjaxManager1.Alert(Resources.GeneralResource.RecordRefreshed);
            return;
        }
        if (nuevo)
        {
            command = String.Format("PatientRecord({0});", pat.PersonId);
        }
        RadAjaxManager1.ResponseScripts.Add(command);
    }
コード例 #4
0
        /// <summary>
        ///     Handles the TabClick event of the _rtsMenu control.
        /// </summary>
        /// <param name = "sender">The source of the event.</param>
        /// <param name = "e">The <see cref = "Telerik.Web.UI.RadTabStripEventArgs" /> instance containing the event data.</param>
        protected void _rtsMenu_TabClick(object sender, RadTabStripEventArgs e)
        {
            switch (e.Tab.Value)
            {
            case "Home":
            {
                RadAjaxManager1.Redirect("~/Default.aspx");
                break;
            }

            case "FindRoom":
            {
                RadAjaxManager1.Redirect("~/App/Pages/FindARoom.aspx");
                break;
            }

            case "PostRoom":
            {
                RadAjaxManager1.Redirect("~/App/Pages/PostARoom.aspx");
                break;
            }

            case "MyAccount":
            {
                RadAjaxManager1.Redirect("~/App/Pages/MyAccount.aspx");
                break;
            }
            }
        }
コード例 #5
0
        protected void btnadd_Click(object sender, EventArgs e)
        {
            string name   = "^[a-zA-Z0-9\u4e00-\u9fa5-]{1,}$";//字母数字汉字-
            Regex  rxname = new Regex(name);

            if (PartName.Text.Trim() == "")
            {
                RadAjaxManager1.Alert("配件名称不能为空!");
                return;
            }
            if (!rxname.IsMatch(PartName.Text.Trim()) && PartName.Text.Trim() != "")
            {
                RadAjaxManager1.Alert("配件名称不能输入特殊字符!");
                return;
            }
            if (bllPart.GetList("  PartName='" + PartName.Text + "'  ").Tables[0].Rows.Count != 0)
            {
                RadAjaxManager1.Alert("该名称已存在!");
                return;
            }
            modelPart.PartID      = DateTime.Now.ToString("yyyyMMddHHmmss");
            modelPart.PartTypeID  = Session["PartTypeID"].ToString();
            modelPart.PartName    = PartName.Text;
            modelPart.PartAddTime = DateTime.Now;
            bllPart.Add(modelPart);
            RadAjaxManager1.Alert("添加成功!");
            ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CloseAndRebind();</script>");
        }
コード例 #6
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            projectTable entity = new projectTable();

            entity.projectID     = -1;
            entity.projectStatus = 0;
            entity.hasDetail     = 0;
            entity.contactName   = tbContactName.Text.Trim();
            string contactPhone = tbContactPhone.Text.Trim();

            if (contactPhone != "")
            {
                entity.contactPhone = contactPhone;
            }
            else
            {
                RadAjaxManager1.Alert("请填写联系方式。"); tbContactPhone.Focus(); return;
            }
            entity.priority = Convert.ToInt32(cmbPriority.SelectedValue);
            if (cmbProjectType.SelectedIndex > 0)
            {
                entity.projectType = Convert.ToInt32(cmbProjectType.SelectedValue);
            }
            else
            {
                RadAjaxManager1.Alert("请选择报修类别。"); cmbProjectType.Focus(); return;
            }
            if (cmbProjectSite.SelectedIndex > 0)
            {
                entity.projectSite = Convert.ToInt32(cmbProjectSite.SelectedValue);
            }
            else
            {
                RadAjaxManager1.Alert("请选择报修地点。"); cmbProjectSite.Focus(); return;
            }
            string detailSite = tbSiteDetail.Text.Trim();

            if (detailSite != "")
            {
                entity.siteDetail = detailSite;
            }
            else
            {
                RadAjaxManager1.Alert("请填写具体位置。"); tbSiteDetail.Focus(); return;
            }
            entity.projectDetail = tbProjectDetail.Text.Trim();
            entity.projectID     = pBLL.addNewRepairProject(entity);
            if (entity.projectID > 0)
            {
                RadAjaxManager1.Alert("报修已提交。");
                Global.InputReset(repairForm);
                //Global.InputReset(queryForm, tbQueryID);
                tbQueryID.Text = entity.projectID.ToString();
                fillQueryForm(entity.projectID.ToString());
            }
            else
            {
                RadAjaxManager1.Alert("提交失败,请重试。");
            }
        }
コード例 #7
0
        protected void RadButton1_Click(object sender, EventArgs e)
        {
            string yh       = "MachineSonName='" + TextBox1.Text + "'";
            string search1  = TextBox1.Text;
            string xxdz1    = TextBox1.Text.Trim();
            Regex  pattern1 = new Regex("[%--`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、? ' ’]");//特殊字符正则判断

            if ((pattern1.IsMatch(xxdz1) == true))
            {
                Response.Write("<script>alert('请不要输入特殊字符!')</script>");
                return;
            }
            DataSet ds = MachineSonType_bll.GetList(yh);

            if (TextBox1.Text == "")//判断输入框是否为空
            {
                Response.Write("<script>alert('请输入设备子类别!')</script>");
                return;
            }
            else if (MachineSonType_bll.GetRecordCount(" MachineSonName ='" + TextBox1.Text + "' ") != 0 && TextBox1.Text != name)//判断是否存在该子类别名称
            {
                Response.Write("<script>alert('该子类别名称已存在!')</script>");
            }
            else
            {
                //Maticsoft.Model.GoodsChildForm modelcclass1 = BLLCClass.GetModel(Request.QueryString["ID"].ToString());//引用id的所有信息
                MachineSonType_Model = MachineSonType_bll.GetModel(Request.QueryString["ID"].ToString());                     //引用id的所有信息
                MachineSonType_Model.MachineSonName = TextBox1.Text;                                                          //添加数据
                MachineSonType_bll.Update(MachineSonType_Model);                                                              //更新数据
                RadAjaxManager1.Alert("修改成功!");                                                                               //提示
                ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CloseAndRebind();</script>"); //关闭弹窗
            }
        }
コード例 #8
0
        protected void RadButton1_Click(object sender, EventArgs e)
        {
            string search1  = TextBox1.Text;
            string xxdz1    = TextBox1.Text.Trim();
            Regex  pattern1 = new Regex("[%--`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?'' ']");//特殊字符正则判断

            if ((pattern1.IsMatch(xxdz1) == true))
            {
                Response.Write("<script>alert('请不要输入特殊字符!')</script>");
                return;
            }

            if (TextBox1.Text == "")//判断输入框是否为空
            {
                Response.Write("<script>alert('请输入设备父类别名称!')</script>");
                return;
            }
            else if (MachineFatherType_bll.GetRecordCount(" MachineFatherName ='" + TextBox1.Text + "' ") != 0)//判断是否存在该父类别
            {
                Response.Write("<script>alert('不能重复添加!')</script>");
            }
            else
            {
                MachineFatherType_Model.MachineFatherID      = DateTime.Now.ToString("yyyyMMddhhmmss");                       //添加数据
                MachineFatherType_Model.MachineFatherName    = TextBox1.Text;                                                 //添加数据
                MachineFatherType_Model.MachineFatherAddTime = DateTime.Now;                                                  //添加数据
                MachineFatherType_bll.Add(MachineFatherType_Model);                                                           //更新数据
                RadAjaxManager1.Alert("添加成功!");                                                                               //提示
                ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CloseAndRebind();</script>"); //关闭弹窗
            }
        }
コード例 #9
0
ファイル: PartsChoice.aspx.cs プロジェクト: Jyf524/Repair
        protected void RadListView1_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
        {
            partsCost si = new partsCost();

            if (e.CommandName == "tian")//判断是不是添加
            {
                PartPutRecordModel = PartPutRecordBLL.GetModelyyy(e.CommandArgument.ToString());
                if ((partsChoice.partsChoiceList.Where(x => x.PartPutRecordID == PartPutRecordModel.PartPutRecordID).Count() == 0)) //判断list里面有没有这条数据
                {
                    Part_Model         = Part_BLL.GetModel(PartPutRecordModel.PartID);                                              //数据库查找信息
                    si.PartID          = PartPutRecordModel.PartID;                                                                 //配件ID(子)
                    si.Partmoney       = PartPutRecordModel.PartPrice.ToString();                                                   //价格
                    si.PartName        = Part_Model.PartName;                                                                       //名字
                    si.PartPicture     = PartPutRecordModel.PartPicture;                                                            //图片
                    si.PartPrice       = PartPutRecordModel.PartPrice.ToString();                                                   //价格
                    si.PartUseNumber   = "1";                                                                                       //数量
                    si.PartPutNumber   = PartPutRecordModel.PartPutNumber.ToString();                                               //库存
                    si.PartPutRecordID = PartPutRecordModel.PartPutRecordID;                                                        //配件入库ID
                    partsChoice.partsChoiceList.Add(si);                                                                            //加入list
                    RadAjaxManager1.Alert("添加成功!");
                    //    return;
                }
                else
                {
                    RadAjaxManager1.Alert("已经添加过该配件!");
                }
            }
        }
コード例 #10
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //判断有无特殊字符,是否为空
            Regex  pattern = new Regex("[%--`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?  ‘’ ']");
            string xxdz    = RadTextBox1.Text.Trim();//删除空格

            if (pattern.IsMatch(xxdz) == true)
            {
                RadAjaxManager1.Alert("请不要输入特殊字符!");
            }
            else
            {
                SeachString = RadTextBox1.Text.Trim();
            }

            Regex  pattern2 = new Regex("[%--`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?  ‘’ ']");
            string xxdz2    = RadTextBox2.Text.Trim();//删除空格

            if (pattern2.IsMatch(xxdz2) == true)
            {
                RadAjaxManager1.Alert("请不要输入特殊字符!");
            }
            else
            {
                SeachString1 = RadTextBox2.Text.Trim();//删除空格
            }
            select();
            RadGrid1.Rebind();//调用方法
        }
コード例 #11
0
 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();
     }
 }
コード例 #12
0
        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            string id = e.CommandArgument.ToString();

            Maticsoft.Model.Replacement molr = bllr.GetModel(id);


            if (e.CommandName.ToString() == "Delete")
            {
                if (molr.ReplacementState == "已借出")
                {
                    RadAjaxManager1.Alert("已借出状态下不可删除!");
                    return;
                }
                if (bllrr.GetRecordCount(" ReplacementID =  '" + id + "' ") != 0)
                {
                    RadAjaxManager1.Alert("已存在借出历史,不可删除!");
                    return;
                }
                if (molr.ReplacementState == "未借出" || molr.ReplacementState == "已报废")
                {
                    bllr.Delete(id);
                    RadGrid1.Rebind();
                }
            }

            if (e.CommandName.ToString() == "GOGO")
            {
                Response.Redirect("SubstitutionDetails.aspx?ID=" + e.CommandArgument + "");//跳转页面
            }
        }
コード例 #13
0
        protected void RadButton1_Click(object sender, EventArgs e)
        {
            //判断是否含有特殊字符
            string yhm     = RadTxtSearchName.Text.Trim();
            Regex  pattern = new Regex("[%--`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]");

            if ((pattern.IsMatch(yhm) == true))
            {
                RadAjaxManager1.Alert("请输入正确搜索条件!");
            }
            else
            {
                SeachString = RadTxtSearchName.Text.Trim();//删除空格
            }
            SeachString1 = ddlPartName.SelectedValue.Trim();
            if (dpstarttime.SelectedDate > dpendtime.SelectedDate)
            {
                RadAjaxManager1.Alert("最小时间不能大于最大时间!");
            }
            else
            {
                SeachString2 = dpstarttime.SelectedDate.ToString();
                SeachString3 = dpendtime.SelectedDate.ToString();
            }
            SeachString4 = ddlUnitsInfo.SelectedItem.Text.Trim(); //删除空格
            select();
            RadGrid1.Rebind();                                    //刷新
        }
コード例 #14
0
ファイル: Main_New.aspx.cs プロジェクト: mkbiltek2019/ERP_6.0
        /// <summary>
        /// 加载当前用户模块
        /// </summary>
        protected void LoadCurrentModules()
        {
            var moduleInfos = ModulePageList;

            if (moduleInfos.Count > 0)
            {
                foreach (var moduleInfo in moduleInfos.Where(ent => ent.ParentID == Guid.Empty))
                {
                    var parent_item = new RadMenuItem {
                        Text = moduleInfo.Name, Value = moduleInfo.ID.ToString()
                    };
                    RadMenu_First.Items.Add(parent_item);
                }
                if (RadMenu_First.Items.Count > 0)
                {
                    RadMenu_First.Items[0].Selected = true;
                }
                else
                {
                    Response.Redirect("default.aspx");
                }
                LoadCurrentPages(moduleInfos.Where(ent => ent.ParentID == RadMenu_First.SelectedValue.ToString().ToGuid()));
            }
            else
            {
                RadAjaxManager1.Alert("数据加载失败,请重新登录!");
            }
        }
コード例 #15
0
ファイル: PartsTypeEdit.aspx.cs プロジェクト: Jyf524/Repair
        protected void btnadd_Click(object sender, EventArgs e)
        {
            string name   = "^[a-zA-Z0-9\u4e00-\u9fa5-]{1,}$";//字母数字汉字-
            Regex  rxname = new Regex(name);

            modelPartType = bllPartType.GetModel(Request.QueryString["ID"].ToString());
            if (PartTypeName.Text.Trim() == "")
            {
                RadAjaxManager1.Alert("配件类别名称不能为空!");
                return;
            }
            if (!rxname.IsMatch(PartTypeName.Text.Trim()) && PartTypeName.Text.Trim() != "")
            {
                RadAjaxManager1.Alert("类别名称不能输入特殊字符!");
                return;
            }
            if (bllPartType.GetList("  PartTypeName='" + PartTypeName.Text + "'  ").Tables[0].Rows.Count != 0 && PartTypeName.Text.Trim() != modelPartType.PartTypeName)
            {
                RadAjaxManager1.Alert("该类别名称已存在!");
                return;
            }
            modelPartType.PartTypeName = PartTypeName.Text;
            bllPartType.Update(modelPartType);
            RadAjaxManager1.Alert("修改成功!");

            ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CloseAndRebind();</script>");
        }
コード例 #16
0
        protected void RadButton2_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(myEditor.InnerText))
            {
                RadAjaxManager1.Alert("请输入故障诊断及维修方案");
                return;
            }
            else
            {
                DeclarationModel.RepairPlan = myEditor.InnerText;
            }

            DeclarationModel.ResultTime = RadDatePicker1.SelectedDate;

            string search2  = TextBox2.Text;
            string xxdz2    = TextBox2.Text.Trim();
            Regex  pattern2 = new Regex("^[0-9]+([.]{1}[0-9]+){0,1}$");

            if (TextBox2.Text == "")
            {
                RadAjaxManager1.Alert("请输入人工费用");
                return;
            }
            else if ((pattern2.IsMatch(xxdz2) == false))
            {
                RadAjaxManager1.Alert("请输入正确的人工费用");

                return;
            }
            else
            {
                DeclarationModel.PersonMoney = Convert.ToDecimal(TextBox2.Text);
            }

            string search3  = TextBox1.Text;
            string xxdz3    = TextBox1.Text.Trim();
            Regex  pattern3 = new Regex("^[0-9]+([.]{1}[0-9]+){0,1}$");

            if (TextBox1.Text == "")
            {
                RadAjaxManager1.Alert("请输入维修费用");
                return;
            }
            else if ((pattern3.IsMatch(xxdz3) == false))
            {
                RadAjaxManager1.Alert("请输入正确的维修费用");
                return;
            }
            else
            {
                DeclarationModel.RepairPrice = Convert.ToDecimal(TextBox1.Text);
            }
            DeclarationModel.DeclarationState = "装备中心已完修";
            DeclarationBLL.Update(DeclarationModel);
            //Response.Redirect("RepairManagementZB.aspx");
            RadAjaxManager1.Redirect("RepairManagementZB.aspx");
            //判断每个输入是否正确正确后加入数据库
        }
コード例 #17
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            projectTable entity = projBLL.getProjectInfoByID(Convert.ToInt32(tbProjectID.Text));

            if (entity != null)
            {
                if (cmbProjectStatus.SelectedIndex > 0)
                {
                    entity.projectStatus = Convert.ToInt32(cmbProjectStatus.SelectedValue);
                }
                if (cmbProjectType.SelectedIndex > 0)
                {
                    entity.projectType = Convert.ToInt32(cmbProjectType.SelectedValue);
                }
                entity.priority = Convert.ToInt32(cmbPriority.SelectedValue);
                if (dateCreate.SelectedDate.HasValue)
                {
                    entity.createDate = dateCreate.SelectedDate.Value;
                }
                if (tbContactName.Text != "")
                {
                    entity.contactName = tbContactName.Text.Trim();
                }
                if (tbContactPhone.Text != "")
                {
                    entity.contactPhone = tbContactPhone.Text.Trim();
                }
                if (tbProjectDetail.Text != "")
                {
                    entity.projectDetail = tbProjectDetail.Text;
                }
                if (cmbProjectSite.SelectedIndex > 0)
                {
                    entity.projectSite = Convert.ToInt32(cmbProjectSite.SelectedValue);
                }
                if (tbSiteDetail.Text != "")
                {
                    entity.siteDetail = tbSiteDetail.Text.Trim();
                }
                if (dateUpdate.SelectedDate.HasValue)
                {
                    entity.updateDate = dateUpdate.SelectedDate.Value;
                }
                if (projBLL.updateProjectInfo(entity))
                {
                    RadAjaxManager1.Alert("更新成功");
                    setInputEnable(false);
                    getProjInfoByID(entity.projectID);
                }
                else
                {
                    RadAjaxManager1.Alert("更新失败");
                }
            }
        }
コード例 #18
0
ファイル: ForeCollect.aspx.cs プロジェクト: Jyf524/RunZe
        protected void RadLV_splb_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
        {
            string Collectid = e.CommandArgument.ToString();

            if (e.CommandName == "Delete")
            {
                string AppriseID1;
                AppriseID1 = e.CommandArgument.ToString();
                Appraise_Bll.DeleteList(e.CommandArgument.ToString());
                RadLV_splb.Rebind();//删除
            }
            if (e.CommandName == "Join")
            {
                string CommodityID1;
                CommodityID1 = e.CommandArgument.ToString();
                Maticsoft.Model.Commodity modelCommodity = Commodity_Bll.GetModel(CommodityID1.ToString());
                if (ShoppingCart_Bll.GetRecordCount(" CommodityID='" + CommodityID1 + "' and UserID='" + UsersInfo.UserID + "' ") > 0)
                {
                    Maticsoft.Model.ShoppingCart modelShoppingCart = ShoppingCart_Bll.GetModel(CommodityID1.ToString());
                    string id = ShoppingCart_Bll.GetList(" CommodityID='" + CommodityID1 + "' and UserID='" + UsersInfo.UserID + "' ").Tables[0].Rows[0]["ShoppingCartID"].ToString();
                    modelShoppingCart = ShoppingCart_Bll.GetModel(id);
                    modelShoppingCart.ShoppingCartID = modelShoppingCart.ShoppingCartID;
                    modelShoppingCart.UserID         = UsersInfo.UserID;
                    modelShoppingCart.CommodityID    = modelCommodity.CommodityID;
                    modelShoppingCart.OrderNumber    = modelShoppingCart.OrderNumber + 1;

                    if (modelShoppingCart.OrderNumber > modelCommodity.Stock)
                    {
                        RadAjaxManager1.Alert("库存不足!");
                        return;
                    }
                    ShoppingCart_Bll.Update(modelShoppingCart);
                }
                else
                {
                    Maticsoft.Model.Users modelusers = Users_Bll.GetModel(UsersInfo.UserID);
                    decimal discount1;
                    if (modelusers.UserGrade == "VIP")
                    {
                        discount1 = Convert.ToDecimal(0.95);
                    }
                    else
                    {
                        discount1 = Convert.ToDecimal(1);
                    }
                    ShoppingCart_Mol.ShoppingCartID = DateTime.Now.ToString("yyyyMMddhhmmss");
                    ShoppingCart_Mol.UserID         = UsersInfo.UserID;
                    ShoppingCart_Mol.CommodityID    = CommodityID1;
                    ShoppingCart_Mol.OrderNumber    = 1;
                    ShoppingCart_Mol.Subtotal       = ((ShoppingCart_Mol.OrderNumber * modelCommodity.VIPPrice) * discount1).ToString();
                    ShoppingCart_Bll.Add(ShoppingCart_Mol);
                }
                RadAjaxManager1.Alert("已添加到购物车!");
            }
        }
コード例 #19
0
        protected void btnQuery_Click(object sender, EventArgs e)
        {
            string queryID   = tbQueryID.Text.Trim();
            string queryName = tbQueryName.Text.Trim();

            if (queryID + queryName == "")
            {
                RadAjaxManager1.Alert("请输入报修单号或报修者姓名。"); return;
            }
            fillQueryForm(queryID, queryName);
        }
コード例 #20
0
 protected void GridDetail_ItemCommand(object sender, GridCommandEventArgs e)
 {
     if (e.CommandName == RadGrid.InitInsertCommandName) //"Add new" button clicked
     {
         e.Canceled = true;
         if (GridProject.SelectedItems.Count == 0)
         {
             RadAjaxManager1.Alert("请先选择报修项目。"); return;
         }
         e.Item.OwnerTableView.InsertItem();
         GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem();
         RadComboBox      cmb          = insertedItem.FindControl("cmbRMList") as RadComboBox;
         if (cmb != null)
         {
             DataTable dt = rmBLL.getAllRepairMen();
             Global.BindComboBoxList(cmb, dt, "repairmanID", "repairmanName", 0);
         }
     }
     else if (e.CommandName == RadGrid.PerformInsertCommandName)
     {
         GridEditableItem editedItem = e.Item as GridEditableItem;
         RadComboBox      cmb        = editedItem.FindControl("cmbRMList") as RadComboBox;
         if (cmb == null || cmb.SelectedIndex == 0)
         {
             RadAjaxManager1.Alert("请选择维修人员。"); e.Canceled = true; return;
         }
         int    rmID    = Convert.ToInt32(cmb.SelectedItem.Value);
         int    projID  = Convert.ToInt32(ViewState["SelectedProjID"]);
         string projRMs = detailBLL.getProjectRepairMan(projID);
         if (projRMs != "" && projRMs.IndexOf(cmb.SelectedItem.Text) > -1)
         {
             RadAjaxManager1.Alert("维修人员已在项目中。"); e.Canceled = true; return;
         }
         int detailID = detailBLL.assignRepairMan(projID, rmID);
         if (detailID > 0)
         {
             DataTable dt     = ViewState["GridDetailData"] as DataTable;
             DataRow   newRow = dt.NewRow();
             newRow["detailID"]    = detailID;
             newRow["projectID"]   = projID;
             newRow["repairmanID"] = rmID;
             dt.Rows.Add(newRow);
             dt.AcceptChanges();
             ViewState["GridDetailData"] = dt;
             GridDetail.Rebind();
             RadAjaxManager1.Alert("添加成功。");
         }
         else
         {
             e.Canceled = true;
         }
     }
 }
コード例 #21
0
 protected void bianji_Click(object sender, EventArgs e)
 {
     if (RadGrid1.SelectedItems.Count > 0)//选中一条数据
     {
         var    selectedItem = RadGrid1.SelectedItems[0];
         string id           = RadGrid1.MasterTableView.DataKeyValues[selectedItem.ItemIndex]["UserID"].ToString();
         Response.Redirect("StudentEdit.aspx?UserID=" + id);
     }
     else
     {
         RadAjaxManager1.Alert("请选择一条数据!");
     }
 }
コード例 #22
0
 protected void btnlook_Click(object sender, EventArgs e)
 {
     if (RadGrid1.SelectedItems.Count > 0)//选中一条数据
     {
         var    selectedItem = RadGrid1.SelectedItems[0];
         string id           = RadGrid1.MasterTableView.DataKeyValues[selectedItem.ItemIndex]["DeclarationID"].ToString();
         Response.Redirect("MaintenanceListWX.aspx?ID=" + id);
     }
     else
     {
         RadAjaxManager1.Alert("请选择一条数据!");
     }
 }
コード例 #23
0
        //搜索按钮
        protected void btnselect_Click(object sender, EventArgs e)
        {
            string name   = "^[a-zA-Z0-9\u4e00-\u9fa5-]{1,}$";//字母数字汉字-
            Regex  rxname = new Regex(name);

            if (!rxname.IsMatch(txtPartName.Text.Trim()) && txtPartName.Text.Trim() != "") //是否有特殊字符
            {
                RadAjaxManager1.Alert("类别名称不能输入特殊字符!");                                    //提示语句
                return;
            }
            PartName = txtPartName.Text.Trim();
            DataLoad();        //绑定数据源方法
            RadGrid1.Rebind(); //重绑数据源
        }
コード例 #24
0
        private void testInsert()
        {
            employeeTable einfo = new employeeTable();

            einfo.employeeID   = -1;
            einfo.employeeName = "Antonio";
            einfo.password     = "******";
            System.Diagnostics.Debug.WriteLine("----insert----");
            System.Diagnostics.Debug.WriteLine("Success? " + eBLL.testInsert(einfo).ToString());
            if (einfo.employeeID != 1)
            {
                RadAjaxManager1.Alert("Antonio needs to be updated.");
            }
        }
コード例 #25
0
        //搜索
        protected void btnselect_Click1(object sender, EventArgs e)
        {
            string name   = "^[a-zA-Z0-9\u4e00-\u9fa5-]{1,}$";//字母数字汉字-
            Regex  rxname = new Regex(name);

            if (!rxname.IsMatch(txtPartTypeName.Text.Trim()) && txtPartTypeName.Text.Trim() != "") //是否含有特殊字符
            {
                RadAjaxManager1.Alert("类别名称不能输入特殊字符!");                                            //提示语句
                return;
            }
            PartTypeName        = txtPartTypeName.Text.Trim();
            RadGrid1.DataSource = bllPartType.GetList(" PartTypeName like '%" + PartTypeName + "%' order by PartTypeAddTime desc ");
            RadGrid1.Rebind();//重绑数据源
        }
コード例 #26
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string path = @"(^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$)";
            Regex  rx   = new Regex(path);

            if (RadTextBox2.Text == "")//判断是否为空
            {
                RadAjaxManager1.Alert("请输入姓名!");
            }
            else if (RadTextBox3.Text == "")//判断是否为空
            {
                RadAjaxManager1.Alert("请输入邮箱!");
            }
            else if (ddlprovince.SelectedValue == "")//判断是否为空
            {
                RadAjaxManager1.Alert("请输入所在地!");
            }
            else if (ddlcity.SelectedValue == "")//判断是否为空
            {
                RadAjaxManager1.Alert("请输入所在地!");
            }
            else if (RadTextBox6.Text == "")//判断是否为空
            {
                RadAjaxManager1.Alert("请输入详细地址!");
            }
            else if (!rx.IsMatch(RadTextBox3.Text))
            {
                RadTextBox3.Text = "";
                RadAjaxManager1.Alert("邮箱格式错误!");
            }
            else
            {
                User_Model = Users_Bll.GetModel(UsersInfo.UserID);
                User_Model.UserRealName = RadTextBox2.Text;//添加数据
                User_Model.Province     = ddlprovince.SelectedValue;
                User_Model.City         = ddlcity.SelectedValue;
                User_Model.Address1     = RadTextBox6.Text;//添加数据
                User_Model.UserEmail    = RadTextBox3.Text;
                if (Rad_nan.Checked == true)
                {
                    User_Model.UserSex = "男";
                }
                else
                {
                    User_Model.UserSex = "女";
                }
                Users_Bll.Update(User_Model);
                Response.Write("<script>alert('修改成功!');window.location.href='ForeVIP.aspx'</script>");
            }
        }
コード例 #27
0
ファイル: BackFatheradd.aspx.cs プロジェクト: Jyf524/RunZe
 protected void Button1_Click(object sender, EventArgs e)
 {
     if ((CommodityFather_BLL.GetList("CommodityFatherName ='" + RadTextBox1.Text + "'").Tables[0].Rows.Count) > 0)
     {
         RadAjaxManager1.Alert("请输入不同名称!");
     }
     else
     {
         CommodityFather_Model.CommodityFatherName = RadTextBox1.Text;
         CommodityFather_Model.CommodityFatherID   = DateTime.Now.ToString("yyyyMMddhhmmss");
         CommodityFather_BLL.Add(CommodityFather_Model);
         ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CloseAndRebind();</script>");
     }
 }
コード例 #28
0
        private void fillQueryForm(string strqueryID, string strQueryName = "")
        {
            projectTable info    = new projectTable();
            int          queryID = 0;

            if (!string.IsNullOrEmpty(strqueryID))
            {
                queryID = Convert.ToInt32(strqueryID);
                info    = pBLL.getProjectInfoByID(queryID);
            }
            else if (!string.IsNullOrEmpty(strQueryName))
            {
                info.contactName = strQueryName;
                DataTable dt = pBLL.getDataTableByEntity(info);
                if (dt.Rows.Count > 0)
                {
                    DataRow row = dt.Rows[0];
                    queryID            = Convert.ToInt32(row["projectID"]);
                    info.projectID     = queryID;
                    info.projectStatus = Convert.ToInt32(row["projectStatus"]);
                    info.projectDetail = row["projectDetail"] == null ? "" : row["projectDetail"].ToString();
                    info.updateDate    = row["updateDate"] == null ? DateTime.MinValue : Convert.ToDateTime(row["updateDate"]);
                }
            }

            if (queryID > 0)
            {
                tbProjectStatus.Text = paramBLL.getProjectStatusByValue(info.projectStatus.Value);
                tbRepairMan.Text     = dBLL.getProjectRepairMan(queryID);
                if (info.projectDetail != null && info.projectDetail != "")
                {
                    tbQueryDetail.Text = info.projectDetail;
                }
                if (info.updateDate != null && info.updateDate > DateTime.MinValue)
                {
                    tbUpdateDate.Text = info.updateDate.Value.ToString("yyyy/MM/dd");
                }

                DataTable dt = dBLL.getDetailDataTableByProjID(queryID);
                if (dt.Rows.Count > 0)
                {
                    tbFaultDetail.Text = dt.Rows[0]["faultDetail"].ToString();
                }
            }
            else
            {
                RadAjaxManager1.Alert("无对应项目,请检查报修单号后重试。");
            }
        }
コード例 #29
0
ファイル: RepairBX.aspx.cs プロジェクト: Jyf524/Repair
        protected void Btn_search_Click(object sender, EventArgs e)
        {
            string name   = "^[a-zA-Z0-9\u4e00-\u9fa5-]{1,}$";//字母数字汉字-
            Regex  rxname = new Regex(name);

            if (!rxname.IsMatch(RadTxtSearchName.Text.Trim()) && RadTxtSearchName.Text.Trim() != "")
            {
                RadTxtSearchName.Text = "";
                RadAjaxManager1.Alert("报修设备名称错误!");
                return;
            }
            State = DropDownList_zt.SelectedValue;
            DataLoad();
            RadGrid1.Rebind();
        }
コード例 #30
0
ファイル: BackFatherchange.aspx.cs プロジェクト: Jyf524/RunZe
 protected void Button1_Click(object sender, EventArgs e)
 {
     Maticsoft.Model.CommodityFather modelnew = CommodityFather_BLL.GetModel(Request.QueryString["ID"].ToString());//引用id所在行的数据
     if ((CommodityFather_BLL.GetList("CommodityFatherName ='" + RadTextBox1.Text + "'").Tables[0].Rows.Count) != 0 && RadTextBox1.Text != modelnew.CommodityFatherName)
     {
         RadAjaxManager1.Alert("请输入不同名称!");
     }
     else
     {
         CommodityFather_Model = CommodityFather_BLL.GetModel(Request.QueryString["ID"].ToString());
         CommodityFather_Model.CommodityFatherName = RadTextBox1.Text;
         CommodityFather_BLL.Update(CommodityFather_Model);
         ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CloseAndRebind();</script>");
     }
 }