Example #1
0
    public void reset()
    {
        if (newPassword.Text != "" && newPassword2.Text != "" && oldPassword.Text != "")
        {
            if (newPassword.Text.Trim().Length < 4 || newPassword.Text.Trim().Length > 10)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001361", "密码长度必须在4到10之间!") + "')</script>");
                return;
            }
            if (newPassword.Text != newPassword2.Text)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001617", "两次密码不一样!") + "')</script>");
                return;
            }
            string Member  = Session["Member"].ToString();
            string NewPass = Encryption.Encryption.GetEncryptionPwd(this.newPassword.Text.ToString(), Session["Member"].ToString());
            string oldPass = Encryption.Encryption.GetEncryptionPwd(this.oldPassword.Text.ToString(), Session["Member"].ToString());
            int    n       = PwdModifyBLL.check(Member, oldPass, int.Parse(this.passtype.SelectedValue));
            string str     = "";
            if (int.Parse(this.passtype.SelectedValue) == 0)
            {
                str = GetTran("006057", "一级密码");
            }
            else
            {
                str = GetTran("006056", "二级密码");
            }
            if (n > 0)
            {
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("Memberinfo", "ltrim(rtrim(number))");
                cl_h_info.AddRecord(Member);

                int i = 0;
                i = PwdModifyBLL.updateMemberPass(Member, NewPass, int.Parse(this.passtype.SelectedValue));
                if (i > 0)
                {
                    cl_h_info.AddRecord(Member);
                    cl_h_info.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.member3, Session["Member"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype6);
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + str + GetTran("000222", "修改成功") + "')</script>");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + str + GetTran("000225", "修改失败!") + "')</script>");
                }
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001624", "原始密码不正确,请准确填写!") + "')</script>");
                return;
            }
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001626", "密码不能为空!") + "')</script>");

            return;
        }
    }
Example #2
0
    /// <summary>
    /// 行触发命令
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void givProviderInfo_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string name = e.CommandName;
        int    id   = Convert.ToInt32(e.CommandArgument);

        int isExistCount = ProviderManageBLL.ProviderIdIsExist(id);

        if (isExistCount > 0)
        {
            if (name == "Del")
            {
                Permissions.CheckManagePermission(EnumCompanyPermission.CustomerProviderViewEditDelete);

                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProviderInfo", "(ltrim(rtrim(id)))");
                cl_h_info.AddRecord(Convert.ToInt32(id));
                int getCount = ProviderManageBLL.ProviderIdWhetherHasOperation(id);
                if (getCount > 0)
                {
                    msg = Transforms.ReturnAlert(GetTran("001356", "对不起,该供应商已经发生了业务,因此不能删除!"));
                    return;
                }

                else
                {
                    int delCount = ProviderManageBLL.Delprivider(id);
                    if (delCount > 0)
                    {
                        cl_h_info.AddRecord(Convert.ToInt32(id));                                                                                                     //不能放到事务中  修改数据后
                        cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company6, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype4); //不能放到事务中

                        msg = Transforms.ReturnAlert(GetTran("000749", "删除成功!"));
                    }

                    else
                    {
                        msg = Transforms.ReturnAlert(GetTran("001387", "删除失败,请联系管理员!"));
                        return;
                    }
                }
            }

            else if (name == "Edit")
            {
                Response.Redirect("AddProvider.aspx?id=" + id);
            }
        }

        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001146", "对不起,该供应商不存在或者已经被删除!")));
        }
        btnSearch_Click(null, null);
    }
Example #3
0
    public void reset()
    {
        var passtype = 0;
        var str      = "";

        if (inlineRadio1.Checked)
        {
            passtype = 0;
            str      = "登录密码";
        }
        else
        {
            passtype = 1;
            str      = "支付密码";
        }
        var member = Session["Member"];

        if (member != null)
        {
            var number  = member.ToString();
            var NewPass = Encryption.Encryption.GetEncryptionPwd(this.newPassword.Text.ToString(), number);
            var oldPass = Encryption.Encryption.GetEncryptionPwd(this.oldPassword.Text.ToString(), number);
            int n       = PwdModifyBLL.check(number, oldPass, passtype);

            if (n > 0)
            {
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("Memberinfo", "ltrim(rtrim(number))");
                cl_h_info.AddRecord(number);

                int i = 0;
                i = PwdModifyBLL.updateMemberPass(number, NewPass, passtype);
                if (i > 0)
                {
                    cl_h_info.AddRecord(number);
                    cl_h_info.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.member3, number, BLL.CommonClass.ENUM_USERTYPE.objecttype6);
                    Response.Redirect("SettingsIndex.aspx?res=success&&type=fanhui");
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + str + "修改成功" + "')</script>");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + str + "修改失败!" + "')</script>");
                }
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('原始密码不正确,请准确填写!')</script>");
                return;
            }
        }
    }
Example #4
0
    /// <summary>
    /// 删除国家
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gvCountry_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "DelCountry")
        {
            int Id = Convert.ToInt32(e.CommandArgument);
            //Judge the CountryCode whether has operation before delete by Id
            int getCount = SetRateBLL.CountryCodeWhetherHasOperation(Id);
            if (getCount > 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002151", "该国家已经发生了业务,因此不能删除!")));
                return;
            }

            else
            {
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("Country", "Id");
                cl_h_info.AddRecord(Id);
                ///删除指定的国家记录
                int delCount = SetRateBLL.DelCountryByID(Id);
                if (delCount > 0)
                {
                    cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company38, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype9);
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002154", "删除国家成功!")));
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002156", "删除国家失败,请联系管理员!")));
                }
            }
            GetCountryInfo();
        }
    }
Example #5
0
    /// <summary>
    /// 删除会员自由购物信息
    /// </summary>
    /// <param name="CommandArgument"></param>
    private void Delete(string CommandArgument)
    {
        //ispay判断是否确认过
        string isPay = null;

        string[] parms            = CommandArgument.Split('|');
        double   totalPV          = new AddFreeOrderDAL().GetTotalPV(parms[2], out isPay);
        double   lackproductmoney = new AddFreeOrderDAL().GetTotalmoney(parms[2]);

        int maxExcept = BLL.CommonClass.CommonDataBLL.getMaxqishu();

        BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberorder", "orderid"); //实例日志类
        cl_h_info.AddRecord(parms[2]);                                                                   //添加日志,修改前记录原来数据

        string result = auditingMemberagainBLL.DelMembersDeclaration(parms[2], totalPV, parms[0], maxExcept, parms[3], lackproductmoney);

        if (result == null)
        {
            cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.store3, Session["Store"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype5);//插入日志

            ScriptHelper.SetAlert(Page, GetTran("000749", "删除成功!"));
            //重新绑定

            BindData();
        }
        else
        {
            ScriptHelper.SetAlert(Page, result);
        }
    }
Example #6
0
    /// <summary>
    /// 删除指定的单据类型信息
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbtDelete_Command(object sender, CommandEventArgs e)
    {
        //Judge the DocTypeID whether exist by DocTypeID before delete or update
        int docTypeId    = Convert.ToInt32(e.CommandArgument);
        int isExistCount = SetParametersBLL.DocTypeIDIsExist(docTypeId);

        if (isExistCount > 0)
        {
            int getCount = SetParametersBLL.DocTypeIDWhetherHasOperation(docTypeId);
            if (getCount > 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005399", "对不起,该单据发生了业务,因此不能删除!")));
                divDocTypeTable.Visible = false;
                return;
            }

            else
            {
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("DocTypeTable", "DocTypeID");
                cl_h_info.AddRecord(docTypeId);
                //删除指定单据类型信息
                int delCount = SetParametersBLL.DelDocTypeTableByID(docTypeId);
                if (delCount > 0)
                {
                    cl_h_info.AddRecord(docTypeId);
                    cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);

                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005400", "删除单据类型成功!")));
                    divDocTypeTable.Visible = false;
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005401", "删除单据类型失败,请联系管理员!")));
                    return;
                }
            }
        }

        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005402", "对不起,该单据不存在或该单据已经被删除!")));
            return;
        }

        DataBindDocTypeTable();
    }
Example #7
0
    /// <summary>
    /// 更新仓库信息
    /// </summary>
    private void UpdWareHouseInfo()
    {
        BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("WareHouse", "WareHouseID");
        cl_h_info.AddRecord(wareHouseModel.WareHouseID);
        ///更新指定的仓库信息
        int updCount = SetParametersBLL.UpdWareHouseByWareHouseID(wareHouseModel);

        if (updCount > 0)
        {
            cl_h_info.AddRecord(wareHouseModel.WareHouseID);
            cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);

            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001693", "修改仓库信息成功!")));
        }

        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001694", "修改仓库信息失败,请联系管理员!")));
        }
    }
Example #8
0
    /// <summary>
    /// 修改城市信息
    /// </summary>
    protected void UpdCityInfo()
    {
        ///修改指定城市信息
        BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("City", "ID");
        cl_h_info.AddRecord(cityModel.Id);

        int updCount = SetParametersBLL.UpdCityByID(cityModel);

        if (updCount > 0)
        {
            cl_h_info.AddRecord(cityModel.Id);
            cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);

            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003234", "修改城市成功!")));
            divCity.Visible = false;
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003233", "修改城市失败,请联系管理员!")));
        }
    }
Example #9
0
    /// <summary>
    /// Delete WareHouse by Id
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbtnWareHouseDelete_Command(object sender, CommandEventArgs e)
    {
        bool isExists = DAL.WareHouseDAL.WareHouseisPermission(Session["Company"].ToString(), DAL.WareHouseDAL.GetWareControlByWareHoseID(int.Parse(e.CommandArgument.ToString())));

        if (!isExists)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001702", "对不起,你没有权限") + "');</script>");
            return;
        }
        int wareHouseId = Convert.ToInt32(e.CommandArgument);
        //Judge the WareHouseId whether exist by Id before delete or update
        int isExistCount = SetParametersBLL.WareHouseIdIsExist(wareHouseId);

        if (isExistCount > 0)
        {
            //Judge the WareHouseId whether has operation by Id before delete
            int getCount = SetParametersBLL.WareHouseIdWhetherHasOperation(wareHouseId);
            if (getCount > 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001703", "对不起,该仓库已经发生了业务,因此不能删除!")));
                return;
            }

            else
            {
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("WareHouse", "WareHouseID");
                cl_h_info.AddRecord(wareHouseId);
                //删除指定仓库信息
                int delCount = SetParametersBLL.DelWareHouseByWareHouseID(wareHouseId);
                if (delCount > 0)
                {
                    cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001704", "删除仓库成功!")));
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001705", "删除仓库失败,请联系管理员!")));
                    return;
                }
            }
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001699", "对不起,该仓库不存在或者已经被删除!")));
            return;
        }

        DataBindWareHouseInfo();
    }
Example #10
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     Application.Lock();
     if (e.CommandName == "D")
     {
         Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.SafeRightManageDelete);
         int manageId = 0;
         try
         {
             manageId = int.Parse(e.CommandArgument.ToString());
         }
         catch (FormatException)
         {
             ScriptHelper.SetAlert(Page, GetTran("001074", "管理员编号不存在!"));
             return;
         }
         ManageModel manageModel = ManagerBLL.GetManage(manageId);
         if (manageModel == null)
         {
             ScriptHelper.SetAlert(Page, GetTran("001076", "该记录已经被删除"));
             return;
         }
         string manageId1 = BLL.CommonClass.CommonDataBLL.getManageID(1);
         if (manageModel.Number.Trim() == manageId1)
         {
             ScriptHelper.SetAlert(Page, GetTran("001079", "不允许删除该记录!"));
             return;
         }
         string number = Session["Company"].ToString();
         if (number != manageId1)
         {
             if (!DeptRoleBLL.CheckAllot(number, manageModel.RoleID))
             {
                 ScriptHelper.SetAlert((Control)sender, GetTran("001080", "不能对该管理员进行操作,没有权限!"));
                 return;
             }
         }
         BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("manage", "id");
         cl.AddRecord(manageId);
         if (ManagerBLL.DelManage(manageId) > 0)
         {
             cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company26, GetTran("001082", "管理员:") + manageModel.Number.Trim(), BLL.CommonClass.ENUM_USERTYPE.objecttype7);
             ScriptHelper.SetAlert((Control)sender, GetTran("000749", "删除成功!"));
             this.Pager1.PageBind();
         }
     }
     Application.UnLock();
 }
Example #11
0
    /// <summary>
    /// 删除指定的产品规格信息
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbtDelete_Command(object sender, CommandEventArgs e)
    {
        int productSpecId = Convert.ToInt32(e.CommandArgument);

        //Judge the ProductSpecId whether exist by Id before delete or update
        int isExistCount = SetParametersBLL.ProductSpecIdIsExist(productSpecId);

        if (isExistCount > 0)
        {
            //Judge the ProductSpecId whether has operation before delete by Id
            int getCount = SetParametersBLL.ProductSpecIdWhetherHasOperation(productSpecId);
            if (getCount > 0)
            {
                divProductSpec.Visible = false;
                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002277", "对不起,该规格已经发生了业务,因此不能删除!")));
                return;
            }

            else
            {
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductSpec", "ProductSpecID");
                cl_h_info.AddRecord(productSpecId);
                //删除指定产品规格信息
                int delCount = SetParametersBLL.DelProductSpecByID(productSpecId);
                if (delCount > 0)
                {
                    cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);

                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002278", "删除规格成功!")));
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002279", "删除规格失败,请联系管理员!")));
                    return;
                }
            }
        }

        else
        {
            divProductSpec.Visible = false;
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002280", "对不起,该规格不存在或者已经被删除!")));
            return;
        }

        DataBindProductSpec();
    }
Example #12
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         int    id        = Convert.ToInt32(e.CommandArgument);
         string managerID = Request.QueryString["manageID"].ToString();
         BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("viewmanage", "id");
         cl.AddRecord(id);
         if (ManagerBLL.DelViewManage(id) > 0)
         {
             cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company25, "管理员:" + managerID, BLL.CommonClass.ENUM_USERTYPE.objecttype7);
             msg = "<script>alert('删除成功!');</script>";
         }
         PageSet();
     }
 }
Example #13
0
    /// <summary>
    /// 删除指定的会员使用银行信息
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbtDelete_Command(object sender, CommandEventArgs e)
    {
        int memberBankId = Convert.ToInt32(e.CommandArgument);
        //Judge the MemberBankId whether exist by Id before delete or update
        int isExistCount = SetParametersBLL.MemberBankIdIsExist(memberBankId);

        if (isExistCount > 0)
        {
            //Juage the MemberBankId whether has operation before delete by Id
            int getCount = SetParametersBLL.MemberBankIdWhetherHasOperation(memberBankId);
            if (getCount > 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005387", "对不起,该银行发生了业务,因此不能删除!")));
                divMemberBank.Visible = false;
                return;
            }

            else
            {
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MemberBank", "BankID");
                cl_h_info.AddRecord(memberBankId);
                //删除指定会员使用银行信息
                int delCount = SetParametersBLL.DelMemberBankByID(memberBankId);
                if (delCount > 0)
                {
                    cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005388", "删除银行成功!")));
                    divMemberBank.Visible = false;
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005389", "删除银行失败,请联系管理员!")));
                    return;
                }
            }
        }

        else
        {
            divMemberBank.Visible = false;
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005390", "对不起,该银行不存在或者已经被删除!")));
            return;
        }

        DataBindMemberBank();
    }
Example #14
0
    /// <summary>
    /// 删除指定的城市信息
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbtDelete_Command(object sender, CommandEventArgs e)
    {
        int cityID = Convert.ToInt32(e.CommandArgument);

        //Judge the CityId whether has operation by Id before delete
        int getCount = SetParametersBLL.CityIdWhetherHasOperation(cityID);

        if (getCount > 0)
        {
            divCity.Visible = false;
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003250", "对不起,该城市已经发生了业务,因此不能删除!")));
            return;
        }
        else
        {
            //Judge the CityID whether exist by Id before delete or update
            int isExistCount = SetParametersBLL.CityIdIsExist(cityID);
            if (isExistCount > 0)
            {
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("City", "ID");
                cl_h_info.AddRecord(cityID);
                ///删除指定城市信息
                int delCount = SetParametersBLL.DelCityByID(cityID);
                if (delCount > 0)
                {
                    cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003249", "删除城市成功!")));
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003248", "删除城市失败,请联系管理员!")));
                    return;
                }
            }
            else
            {
                divCity.Visible = false;
                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003244", "对不起,该城市不存在或者已经被删除!")));
                return;
            }
        }

        DataBindCity();
    }
Example #15
0
    protected void givSearchStoreInfo_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int ID = Convert.ToInt32(e.CommandArgument.ToString());

        if (e.CommandName == "del")
        {
            GridViewRow row     = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
            string      storeid = row.Cells[1].Text;
            int         k       = StoreInfoEditBLL.getMemberCount(storeid);
            if (k == 0)
            {
                int i = 0;
                StoreInfoEditBLL           seb       = new StoreInfoEditBLL();
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("storeinfo", "(ltrim(rtrim(id)))");
                cl_h_info.AddRecord(ID);
                i = seb.DelStore(ID);
                cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company4, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype2);
                if (i > 0)
                {
                    //Response.Write("<script language='javascript'>alert('删除成功!')</script>");
                    this.msg = "<script language='javascript'>alert('" + GetTran("000749", "删除成功!") + "')</script>";
                    BtnSeach_Click(null, null);
                }
                else
                {
                    //Response.Write("<script language='javascript'>alert('删除失败!')</script>");
                    this.msg = "<script language='javascript'>alert('" + GetTran("000417", "删除失败!") + "')</script>";
                    return;
                }
            }
            else
            {
                this.msg = "<script language='javascript'>alert('" + GetTran("000756", "对不起,该店铺已经发生了业务关系,不能删除!") + "')</script>";
                return;
            }
        }
        else
        {
            BtnSeach_Click(null, null);
        }
    }
Example #16
0
 protected void gvDeptRoless_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     Application.Lock();
     if (e.CommandName == "D")
     {
         Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.SafeRightManageDelete);
         string number   = Session["Company"].ToString();
         int    roleId   = int.Parse(e.CommandArgument.ToString());
         string manageId = BLL.CommonClass.CommonDataBLL.getManageID(1);//返回当前登录管理员的编号,主要为了防止不超时
         if (number != manageId)
         {
             if (!DeptRoleBLL.CheckAllot(number, roleId))
             {
                 ScriptHelper.SetAlert((Control)sender, GetTran("000975", "不能对该角色进行操作,没有权限!"));
                 return;
             }
         }
         if (DeptRoleBLL.GetCountByRoleId(roleId) > 0)
         {
             ScriptHelper.SetAlert((Control)sender, GetTran("000977", "该角色下还存在管理员,请先删除该角色下的管理员!"));
             return;
         }
         else
         {
             BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("deptRole", "id");
             cl.AddRecord(roleId);
             string msg = DeptRoleBLL.DelDeptRole(HttpContext.Current, int.Parse(e.CommandArgument.ToString()));
             if (msg == "删除角色成功.")
             {
                 ScriptHelper.SetAlert((Control)sender, msg, "DeptRolesManage.aspx");
                 cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company25, GetTran("000981", "角色:") + int.Parse(e.CommandArgument.ToString()), BLL.CommonClass.ENUM_USERTYPE.objecttype7);
             }
             ScriptHelper.SetAlert((Control)sender, msg);
             PageSet();
         }
     }
     Application.UnLock();
 }
Example #17
0
    protected void gvCompanyDepts_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Application.Lock();
        if (e.CommandName == "D")
        {
            Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.SafeRightDpetManage);
            if (CompanyDeptBLL.GetDeptRoleCount(int.Parse(e.CommandArgument.ToString())))
            {
                BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("companydept", "id");
                cl.AddRecord(int.Parse(e.CommandArgument.ToString()));

                //部门是否存在
                if (!CompanyDeptBLL.IsHaaveCompanyDept(int.Parse(e.CommandArgument.ToString())))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "提示", "alert('部门已经被删除!');", true);
                    return;
                }

                if (CompanyDeptBLL.DelCompanyDept(int.Parse(e.CommandArgument.ToString())))
                {
                    cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company24, "部门:" + int.Parse(e.CommandArgument.ToString()), BLL.CommonClass.ENUM_USERTYPE.objecttype7);
                    ScriptHelper.SetAlert(this.Page, "删除部门成功!");
                    PageSet();
                }
                else
                {
                    ScriptHelper.SetAlert(this.Page, "该部门已经删除,无法重复执行!");
                    PageSet();
                }
            }
            else
            {
                ScriptHelper.SetAlert(this.Page, "该部门下已经安排有角色,请先删除角色再删除部门!");
            }
        }
        Application.UnLock();
    }
Example #18
0
    protected void givMessageSend_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        BLL.other.Company.MessageReceiveBLL bll = new MessageReceiveBLL();

        string name = e.CommandName;
        int    id   = Convert.ToInt32(e.CommandArgument.ToString());

        if (name == "Del")
        {
            BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MessageSend", "ltrim(rtrim(id))");
            cl_h_info.AddRecord(id);
            cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company19, id.ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype10);

            if (bll.delGongGao(id) > 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000008", "删除成功") + "!!!');</script>");
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000009", "删除失败") + "!!!');</script>");
            }

            btnseach_Click(null, null);
        }
        else if ("Distal" == name)
        {
            Response.Redirect("ShowMessage.aspx?id=" + id);
        }
        else if ("GO" == name)
        {
            Response.Redirect("MessageContent.aspx?id=" + e.CommandArgument.ToString() + "&T=messagesend&source=ManageQueryGongGao.aspx");
        }
        else
        {
            Response.Redirect("ManageAffiche.aspx?id=" + id);
        }
    }
Example #19
0
    protected void BtnModify_Click(object sender, EventArgs e)
    {
        int id = (int)ViewState["id"];

        if (this.txtDept.Text.Trim() == "")
        {
            ScriptHelper.SetAlert(this.Page, GetTran("001043", "请填写部门名称"));
        }
        else if (this.txtDept.Text.Trim().Length < 3)
        {
            ScriptHelper.SetAlert((Control)sender, GetTran("001034", "部门名称必须3个字符以上!"));
        }
        else
        {
            if (CompanyDeptBLL.CheckName(this.txtDept.Text.Trim(), id)) //是否重名,重名不能添加
            {
                ScriptHelper.SetAlert(this.Page, GetTran("001036", "部门名称存在!"));
            }
            else
            {
                CompanyDeptModel comDept = new CompanyDeptModel(id);
                comDept.Dept = this.txtDept.Text.Trim();
                BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("companyDept", "id");
                cl.AddRecord(id);
                if (CompanyDeptBLL.UptCompanyDept(comDept))
                {
                    cl.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.company24, GetTran("001047", "部门:") + id, BLL.CommonClass.ENUM_USERTYPE.objecttype7);
                    ScriptHelper.SetAlert(this.Page, GetTran("001050", "修改部门成功"), "CompanyDeptManage.aspx");
                }
                else
                {
                    ScriptHelper.SetAlert(this.Page, GetTran("001052", "修改部门失败!"), "CompanyDeptManage.aspx");
                }
            }
        }
    }
Example #20
0
    /// <summary>
    /// 提交事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        bool flag = SetValueProductSizeModel();

        if (flag)
        {
            if ((int)ViewState["ID"] == 1)
            {
                ///获取指定产品尺寸的行数
                int getCount = SetParametersBLL.GetProductSizeCountByName(txtProductSizeName.Text.Trim());
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002261", "该尺寸已经存在!")));
                }

                else
                {
                    //添加尺寸信息
                    int addCount = SetParametersBLL.AddProductSize(productSizeModel);
                    if (addCount > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002263", "添加尺寸成功!")));
                        divProductSize.Visible = false;
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002264", "添加尺寸失败,请联系管理员!")));
                    }
                }
            }

            if ((int)ViewState["ID"] == 2)
            {
                ///获取指定产品尺寸的行数
                int getCount = SetParametersBLL.GetProductSizeCountByIDName(Convert.ToInt32(ViewState["ProductSizeID"]), txtProductSizeName.Text.Trim());
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002261", "该尺寸已经存在!")));
                }

                else
                {
                    BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductSize", "ProductSizeID");
                    cl_h_info.AddRecord(productSizeModel.ProductSizeID);
                    ///修改指定产品尺寸信息
                    int updCount = SetParametersBLL.UpdProductSizeByID(productSizeModel);
                    if (updCount > 0)
                    {
                        cl_h_info.AddRecord(productSizeModel.ProductSizeID);
                        cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);

                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002265", "修改尺寸成功!")));
                        divProductSize.Visible = false;
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002266", "修改尺寸失败,请联系管理员!")));
                    }
                }
            }
            DataBindProductSize();
        }

        else
        {
            return;
        }
    }
Example #21
0
    /// <summary>
    /// 修改角色的操作事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnUpt_Click(object sender, EventArgs e)
    {
        Application.Lock();
        if (ViewState["roleid"] == null)
        {
            Response.Redirect("DeptRolesManage.aspx");
        }
        if (txtRoleName.Text.Trim() == "")
        {
            ScriptHelper.SetAlert((Control)sender, GetTran("001183", "请输入角色名称!"));
            return;
        }
        else
        {
            if (this.txtRoleName.Text.Trim().Length < 3)
            {
                ScriptHelper.SetAlert((Control)sender, GetTran("000999", "角色名称必须3个字符以上!"));
                return;
            }
        }
        if (txtRoleName.Text != ViewState["Name"].ToString())
        {
            if (DeptRoleBLL.CheckDeptRoleName(this.txtRoleName.Text.Trim(), (int)ViewState["roleid"]) != null)
            {
                ScriptHelper.SetAlert((Control)sender, GetTran("001001", "角色名称已经存在!"));
                return;
            }
        }
        int    roleId   = (int)ViewState["roleid"];
        string number   = Session["Company"].ToString();
        string manageId = BLL.CommonClass.CommonDataBLL.getManageID(1);

        if (number != manageId)
        {
            if (!DeptRoleBLL.CheckAllot(number, roleId))
            {
                ScriptHelper.SetAlert((Control)sender, GetTran("000975", "不能对该角色进行操作,没有权限!"));
                return;
            }
        }
        DeptRoleModel deptRole = new DeptRoleModel(roleId);

        deptRole.DeptID = int.Parse(this.ddlDepts.SelectedValue);
        string ids = Request.Form["qxCheckBox"]; //获取所有选中的菜单的值(pmID),在生成的页面可以查看(后台拼接而成),qxCheckBox是菜单的name(checkbox的name)

        string[]  id  = ids.Split(',');
        Hashtable htb = (Hashtable)Session["permission"];

        htb = DeptRoleBLL.GetAllPermission(Session["Company"].ToString());
        Hashtable htb2 = new Hashtable();
        int       i    = -1;

        if (number != manageId)
        {
            foreach (string n in id)
            {
                if (htb.Contains(int.Parse(n)))
                {
                    htb2.Add(n, "0");
                }
                else
                {
                    i = 0;
                }
            }
        }
        else
        {
            foreach (string n in id)
            {
                if (htb.Contains(int.Parse(n)))
                {
                    htb2.Add(n, "0");
                }
            }
        }
        if (i == -1)
        {
            BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("deptRole", "id");
            cl.AddRecord(roleId);

            deptRole.htbPerssion = htb2;
            deptRole.Name        = this.txtRoleName.Text.Trim();
            deptRole.Allot       = ((CheckBox)this.UCPermission1.FindControl("chkAllot")).Checked ? 1 : 0;
            if (DeptRoleBLL.UptDeptRole(deptRole)) //修改角色
            {
                cl.AddRecord(roleId);
                cl.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.company25, "角色:" + deptRole.Name, BLL.CommonClass.ENUM_USERTYPE.objecttype7);
                ScriptHelper.SetAlert((Control)sender, GetTran("000001", "修改成功."), "DeptRolesManage.aspx");
            }
            else
            {
                ScriptHelper.SetAlert((Control)sender, GetTran("000002", "修改失败."), "DeptRolesManage.aspx");
            }
        }
        else
        {
            ScriptHelper.SetAlert((Control)sender, GetTran("001003", "异常数据"), "DeptRolesManage.aspx");
            return;
        }
        Application.UnLock();
    }
Example #22
0
    protected void btn_ok_Click(object sender, EventArgs e)
    {
        string newpass = getpass();

        if (this.RadioButtonList1.SelectedValue == "4")
        {
            if (newpass.Length < 6 || newpass.Length > 10)
            {
                msg = "<script>alert('密码必须是6到10位!');</script>";
                return;
            }
        }
        //判断是否选择修改密码
        bool flag = false;

        foreach (ListItem lst in chkPass.Items)
        {
            if (lst.Selected)
            {
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            msg = "<script>alert('请选择要修改的密码类型!');</script>";
            return;
        }
        int    count = 0;
        string type  = Request.QueryString["type"].ToString();//类型
        string id    = "";

        if (GetType() != "3")
        {
            id = Request.QueryString["ID"].ToString();//店铺编号
        }


        string number = Request.QueryString["number"].ToString();//会员编号

        if (type.Length > 0 && number.Length > 0)
        {
            if (type == "1")
            {
                foreach (ListItem lst in chkPass.Items)
                {
                    if (lst.Selected)
                    {
                        if (lst.Value == "one")
                        {
                            switch (this.RadioButtonList1.SelectedValue.ToString())
                            {
                            case "1": count = mb.updateMemberPass(number, 0); break;                   //手机

                            case "2": count = MemberInfoDAL.updateMemberPass1(number, newpass); break; //邮件

                            case "3": count = MemberInfoDAL.updateMemberPass1(number, newpass); break; //商店

                            case "4": count = MemberInfoDAL.updateMemberPass1(number, newpass); break; //手动
                            }
                        }
                        else
                        {
                            switch (this.RadioButtonList1.SelectedValue.ToString())
                            {
                            case "1": count = mb.updateMemberPass(number, 1); break;

                            case "2": count = MemberInfoDAL.updateMemberPass2(number, newpass); break;

                            case "3": count = MemberInfoDAL.updateMemberPass2(number, newpass); break;

                            case "4": count = MemberInfoDAL.updateMemberPass2(number, newpass); break;
                            }
                        }
                    }
                }
            }
            else if (type == "2")
            {
                foreach (ListItem lst in chkPass.Items)
                {
                    if (lst.Selected)
                    {
                        if (lst.Value == "one")
                        {
                            switch (this.RadioButtonList1.SelectedValue.ToString())
                            {
                            case "1": count = StoreInfoDAL.StorePassReset(id, newpass); break; //店铺编号

                            case "2": count = StoreInfoDAL.StorePassReset(id, newpass); break; //邮件

                            case "3": count = StoreInfoDAL.StorePassReset(id, id); break;      //服务机构

                            case "4": count = StoreInfoDAL.StorePassReset(id, newpass); break;
                            }
                        }
                        else
                        {
                            switch (this.RadioButtonList1.SelectedValue.ToString())
                            {
                            case "1": count = StoreInfoDAL.StorePassReset1(id, newpass); break;

                            case "2": count = StoreInfoDAL.StorePassReset1(id, newpass); break;

                            case "3": count = StoreInfoDAL.StorePassReset1(id, id); break;

                            case "4": count = StoreInfoDAL.StorePassReset1(id, newpass); break;
                            }
                        }
                    }
                }
            }
            else if (type == "3")
            {
                if (RadioButtonList1.SelectedValue == "1")
                {
                    count = ManageDAL.UpdateManagePass(number, number);
                }
                else
                {
                    count = ManageDAL.UpdateManagePass(number, newpass);
                }
            }
            if (count > 0)
            {
                if (type == "1")
                {
                    cl_h_info = new BLL.CommonClass.ChangeLogs("memberinfo", "number");
                    cl_h_info.AddRecord(number);
                }
                else if (type == "2")
                {
                    cl_h_info = new BLL.CommonClass.ChangeLogs("storeinfo", "storeid");
                    cl_h_info.AddRecord(id);
                }
                else if (type == "3")
                {
                    cl_h_info = new BLL.CommonClass.ChangeLogs("Manage", "Number");
                    cl_h_info.AddRecord(number);
                }
                string mess = "";

                if (type == "1")
                {
                    foreach (ListItem lst in chkPass.Items)
                    {
                        if (lst.Selected)
                        {
                            if (lst.Value == "one")
                            {
                                mess = GetTran("006589", "您好,您的会员一级密码重置成功,密码为:") + newpass;
                            }
                            else
                            {
                                if (mess.Contains("您好"))
                                {
                                    mess += GetTran("000000", ",您的会员二级密码重置成功,密码为:") + newpass;
                                }
                                else
                                {
                                    mess = GetTran("006590", "您好,您的会员二级密码重置成功,密码为:") + newpass;
                                }
                            }
                        }
                    }
                }
                else if (type == "2")
                {
                    foreach (ListItem lst in chkPass.Items)
                    {
                        if (lst.Selected)
                        {
                            if (lst.Value == "one")
                            {
                                mess = GetTran("006680", "您好,您的店铺一级密码重置成功,密码为:") + newpass;
                            }
                            else
                            {
                                if (mess.Contains("您好"))
                                {
                                    mess += GetTran("000000", ",您的店铺二级密码重置成功,密码为:") + newpass;
                                }
                                else
                                {
                                    mess = GetTran("006588", "您好,您的店铺二级密码重置成功,密码为:") + newpass;
                                }
                            }
                        }
                    }
                }

                if (this.RadioButtonList1.SelectedValue.ToString() == "3")
                {
                    SqlTransaction tran = null;
                    SqlConnection  con  = DAL.DBHelper.SqlCon();
                    con.Open();
                    tran = con.BeginTransaction();
                    try
                    {
                        string outInfo = string.Empty;
                        if (type == "1" || type == "2")
                        {
                            BLL.MobileSMS.SendMsgTo(tran, number, "", this.txt_1.Text.ToString(), mess, out outInfo, Model.SMSCategory.sms_menberPassRest);
                        }
                        if (type == "3" || type == "4")
                        {
                            BLL.MobileSMS.SendMsgTo(tran, number, "", this.txt_1.Text.ToString(), mess, out outInfo, Model.SMSCategory.sms_storePassRest);
                        }
                        tran.Commit();
                    }
                    catch
                    {
                        tran.Rollback();
                    }
                    finally
                    {
                        con.Close();
                        con.Dispose();
                    }
                }
                else if (this.RadioButtonList1.SelectedValue.ToString() == "2")
                {
                    string title = "";
                    title = type == "1" ? "会员密码重置" : "服务机构密码重置";
                    if (send(mess, title))
                    {
                        msg = "<script language='javascript'>alert('" + GetTran("006681", "重置成功,请到邮箱查阅密码!") + "');this.close();</script>";
                        return;
                    }
                }
                else
                {
                    if (type == "1")
                    {
                        PublicClass.SendMsg(3, number, mess);
                    }
                    else if (type == "2")
                    {
                        PublicClass.SendMsg(4, number, mess);
                    }
                }

                if (type == "1" || type == "2")
                {
                    cl_h_info.AddRecord(id);
                    cl_h_info.ModifiedIntoLogs(ChangeCategory.company5, id, ENUM_USERTYPE.objecttype6);
                }
                else if (type == "3" || type == "4")
                {
                    cl_h_info.AddRecord(number);
                    cl_h_info.ModifiedIntoLogs(ChangeCategory.company1, number, ENUM_USERTYPE.objecttype6);
                }
                msg = "<script language='javascript'>alert('" + GetTran("000506", "重置成功!") + "');this.close();</script>";
            }
            else
            {
                msg = "<script language='javascript'>alert('" + GetTran("000507", "重置失败!") + "');this.close();</script>";
            }
        }
    }
Example #23
0
    /// <summary>
    /// 提交事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        bool flag = SetValueProductSexTypeModel();

        if (flag)
        {
            if ((int)ViewState["ID"] == 1)
            {
                //获取指定产品适用人群的行数
                int getCount = SetParametersBLL.GetProductSexTypeCountByName(txtProductSexTypeName.Text.Trim());
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002226", "该适用人群已经存在!")));
                }

                else
                {
                    //添加适用人群信息
                    using (SqlConnection conn = new SqlConnection(DBHelper.connString))
                    {
                        int id;
                        conn.Open();
                        using (SqlTransaction tran = conn.BeginTransaction())
                        {
                            try
                            {
                                SetParametersBLL.AddProductSexType(tran, productSexTypeModel, out id);
                                language.AddNewTranslationRecord(tran, "ProductSexType", "ProductSexTypeName", id, txtProductSexTypeName.Text.Trim(), txtProductSexTypeName.Text.Trim());
                                language.AddNewTranslationRecord(tran, "ProductSexType", "ProductSexTypeDescr", id, txtProductSexTypeDescr.Text.Trim(), txtProductSexTypeDescr.Text.Trim());
                                tran.Commit();
                            }

                            catch
                            {
                                tran.Rollback();
                                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002229", "添加适用人群失败,请联系管理员!")));
                                return;
                            }

                            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002227", "添加适用人群成功!")));
                            divProductSexType.Visible = false;
                        }
                    }
                }
            }

            if ((int)ViewState["ID"] == 2)
            {
                ///获取指定产品适用人群的行数
                int getCount = SetParametersBLL.GetProductSexTypeCountByIDName(Convert.ToInt32(ViewState["ProductSexTypeID"]), txtProductSexTypeName.Text.Trim());
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002226", "该适用人群已经存在!")));
                    return;
                }

                else
                {
                    BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductSexType", "ProductSexTypeID");
                    cl_h_info.AddRecord(productSexTypeModel.ProductSexTypeID);
                    ///修改指定产品适用人群信息
                    int updCount = SetParametersBLL.UpdProductSexTypeByID(productSexTypeModel);
                    if (updCount > 0)
                    {
                        cl_h_info.AddRecord(productSexTypeModel.ProductSexTypeID);
                        cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);

                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002230", "修改适用人群成功!")));
                        divProductSexType.Visible = false;
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002231", "修改适用人群失败,请联系管理员!")));
                    }
                }
            }
            DataBindProductSexType();
        }

        else
        {
            return;
        }
    }
Example #24
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
        {
            ProviderInfoModel provider = new ProviderInfoModel();
            provider.Address     = txtAddress.Text.Trim();
            provider.BankAddress = txtBankAddress.Text.Trim();
            provider.BankName    = ddlBankName.SelectedValue;
            provider.BankNumber  = txtBankNumber.Text.Trim();
            provider.ID          = Convert.ToInt32(ViewState["id"]);
            provider.DutyNumber  = txtDutyNumber.Text.Trim();
            provider.Email       = txtEmail.Text.Trim();
            provider.Fax         = txtFax.Text.Trim();
            provider.ForShort    = txtForShort.Text.Trim();
            provider.LinkMan     = txtLinkMan.Text.Trim();

            provider.Mobile    = txtMobile.Text.Trim();
            provider.Name      = txtName.Text.Trim();
            provider.Number    = lblNumber.Text.Trim();
            provider.Remark    = txtRemark.Text.Trim();
            provider.Telephone = txtTelephone.Text.Trim();

            provider.Url = txtUrl.Text.Trim();

            provider.OperateIP     = Request.UserHostAddress;
            provider.OperateNum    = CommonDataBLL.OperateBh;
            provider.Status        = 1;
            provider.PermissionMan = "";

            int providerNameIsExist = ProviderManageBLL.ProviderNameIsExist(provider.ID, provider.Name);
            if (providerNameIsExist > 0)
            {
                this.msg = "<script language='javascript'>alert('" + GetTran("001170", "该供应商名称已被注册,请换一个供应商名称!") + "');</script>";
                return;
            }
            BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProviderInfo", "(ltrim(rtrim(id)))");
            cl_h_info.AddRecord(Convert.ToInt32(provider.ID));
            int updCount = ProviderManageBLL.UpdatePrivider(provider);
            if (updCount > 0)
            {
                cl_h_info.AddRecord(Convert.ToInt32(provider.ID));                                                                                             //不能放到事务中  修改数据后
                cl_h_info.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.company6, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype4); //不能放到事务中

                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("000222", "修改成功!") + "');location.href='Provider_ViewEdit.aspx'</script>");
            }
            else
            {
                ScriptHelper.SetAlert(this.Page, GetTran("001190", "修改失败,请检查你输入的信息!"));
            }
        }

        //Add Provider
        else
        {
            string number = DisposeString.DisString(txtnumber.Text.Trim());
            if (ProviderManageBLL.GetProviderinfoNumber(number))
            {
                this.msg = "<script language='javascript'>alert('" + GetTran("001162", "该供应商编号已被注册,请换一个供应商编号!") + "');</script>";
                return;
            }
            if (ProviderManageBLL.ProviderNameIsExist(txtName.Text.Trim()) > 0)
            {
                this.msg = "<script language='javascript'>alert('" + GetTran("001170", "该供应商名称已被注册,请换一个供应商名称!") + "');</script>";
                return;
            }
            ProviderInfoModel provider = new ProviderInfoModel();
            provider.Address     = DisposeString.DisString(txtAddress.Text.Trim());
            provider.BankAddress = DisposeString.DisString(txtBankAddress.Text.Trim());
            provider.BankName    = DisposeString.DisString(ddlBankName.SelectedValue);
            provider.BankNumber  = DisposeString.DisString(txtBankNumber.Text.Trim());
            provider.DutyNumber  = DisposeString.DisString(txtDutyNumber.Text.Trim());
            provider.Email       = DisposeString.DisString(txtEmail.Text.Trim());
            provider.Fax         = DisposeString.DisString(txtFax.Text.Trim());
            provider.ForShort    = DisposeString.DisString(txtForShort.Text.Trim());
            provider.LinkMan     = DisposeString.DisString(txtLinkMan.Text.Trim());
            provider.Mobile      = DisposeString.DisString(txtMobile.Text.Trim());
            provider.Name        = DisposeString.DisString(txtName.Text.Trim());

            provider.Remark        = DisposeString.DisString(txtRemark.Text.Trim());
            provider.Telephone     = DisposeString.DisString(txtTelephone.Text.Trim());
            provider.Url           = DisposeString.DisString(txtUrl.Text.Trim());
            provider.OperateIP     = Request.UserHostAddress;
            provider.OperateNum    = CommonDataBLL.OperateBh;
            provider.Status        = 1;
            provider.Number        = number;
            provider.PermissionMan = "";

            int addCount = ProviderManageBLL.AddPrivider(provider);
            if (addCount > 0)
            {
                this.msg = "<script language='javascript'>alert('" + GetTran("001194", "保存成功!") + "');location.href='Provider_ViewEdit.aspx'</script>";
            }
            else
            {
                ScriptHelper.SetAlert(this.btnSave, GetTran("001177", "添加失败,请检查你输入的信息!"));
            }
        }
    }
Example #25
0
    /// <summary>
    /// 提交事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        ///给会员使用银行模型层赋值
        bool flag = SetValueMemberBankModel();

        if (flag)
        {
            if ((int)ViewState["ID"] == 1)
            {
                ///获取指定会员使用银行的行数
                int getCount = SetParametersBLL.GetMemberBankCountByNameCountryCode(memberBankModel);
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005392", "该银行已经存在!")));
                }

                else
                {
                    ///添加银行信息
                    int addCount = SetParametersBLL.AddMemberBank(memberBankModel);
                    if (addCount > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005393", "添加银行成功!")));
                        divMemberBank.Visible = false;
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005394", "添加银行失败,请联系管理员!")));
                        return;
                    }
                }
            }

            if ((int)ViewState["ID"] == 2)
            {
                ///获取指定会员使用银行的行数
                int getCount = SetParametersBLL.GetMemberBankCountByAll(memberBankModel);
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005392", "该银行已经存在!")));
                }

                else
                {
                    BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MemberBank", "BankID");
                    cl_h_info.AddRecord(memberBankModel.BankID);
                    ///修改指定会员使用银行信息
                    int updCount = SetParametersBLL.UpdMemberBankByID(memberBankModel);
                    if (updCount > 0)
                    {
                        cl_h_info.AddRecord(memberBankModel.BankID);
                        cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);

                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005395", "修改银行成功!")));
                        this.divMemberBank.Visible = false;
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005396", "修改银行失败,请联系管理员!")));
                    }
                }
            }
            DataBindMemberBank();
        }

        else
        {
            return;
        }
    }
Example #26
0
    protected void Button1_Click1(object sender, EventArgs e)
    {
        #region 部分验证
        int exists;
        //int exists1;
        // exists1 = (int)DBHelper.ExecuteScalar("select count(*) from MemberInfo where Number = '" + this.Number.Text.ToString() + "' ");
        if (this.Number.Text.Trim() == "")
        {
            msg = "<script>alert('" + GetTran("000787", "请输入编号!") + "');</script>";
            return;
        }
        exists = (int)DBHelper.ExecuteScalar("SELECT COUNT(*) FROM MemberInfo WHERE Number='" + this.Number.Text + "'", CommandType.Text);
        if (exists <= 0)
        {
            msg = "<script language='javascript'>alert('" + GetTran("000794", "对不起,该会员编号不存在!") + "')</script>";
            return;
        }
        if (this.StoreID.Text.Trim() == "")
        {
            msg = "<script language='javascript'>alert('" + GetTran("000796", "对不起,请输入店编号!") + "')</script>";
            return;
        }
        //检查店编号是否存在
        exists = (int)DBHelper.ExecuteScalar("SELECT COUNT(*) FROM StoreInfo WHERE StoreID='" + this.StoreID.Text.Trim() + "' and id<>" + ViewState["id"].ToString(), CommandType.Text);
        if (exists > 0)
        {
            msg = "<script language='javascript'>alert('" + GetTran("000798", "对不起,该店编号已经存在!") + "')</script>";
            return;
        }
        if (this.Remark.Text.ToString().Length > 150)
        {
            msg = "<script language='javascript'>alert('" + GetTran("006896", "对不起,备注应在150个字以内!") + "')</script>";
            return;
        }
        if (this.Address.Text.ToString().Length <= 0)
        {
            msg = "<script language='javascript'>alert('" + GetTran("001280", "地址不能为空!") + "')</script>";
            return;
        }

        DateTime dt1;
        try
        {
            dt1 = Convert.ToDateTime(this.RegisterDate.Text.ToString());
        }
        catch
        {
            msg = "<script language='javascript'>alert('" + GetTran("000799", "对不起,指定的开始时间错误,请检查!") + "')</script>";
            return;
        }

        int ExpectNum;
        try
        {
            ExpectNum = Convert.ToInt32(this.ExpectNum.Text.ToString());
        }
        catch
        {
            msg = "<script language='javascript'>alert('" + GetTran("000803", "对不起,办店期数不能为空且必需是数字!") + "')</script>";
            return;
        }
        if (ExpectNum > CommonDataBLL.GetMaxqishu())
        {
            msg = "<script language='javascript'>alert('" + GetTran("000807", "对不起,办店期数不能超过最大期数!") + "')</script>";
            return;
        }
        int StorageScalar = 0;
        if (this.StorageScalar.Text != "")
        {
            try
            {
                StorageScalar = Convert.ToInt32(this.StorageScalar.Text.Trim());
            }
            catch
            {
                msg = "<script language='javascript'>alert('" + GetTran("000814", "对不起,库存底线必须是数字!") + "')</script>";
                return;
            }
        }
        decimal FareArea = 0;
        if (this.FareArea.Text != "")
        {
            try
            {
                FareArea = Convert.ToDecimal(this.FareArea.Text.ToString());
            }
            catch
            {
                msg = "<script language='javascript'>alert('" + GetTran("000818", "对不起,面积必须是数字!") + "')</script>";
                return;
            }
        }

        decimal TotalInvestMoney = 0;
        if (this.TotalInvestMoney.Text.ToString() != "")
        {
            try
            {
                TotalInvestMoney = decimal.Parse(this.TotalInvestMoney.Text.ToString());
            }
            catch
            {
                msg = "<script language='javascript'>alert('" + GetTran("000820", "对不起,投资总额必须是数字!") + "')</script>";
                return;
            }
        }
        if (this.CountryCity1.Country == "请选择")
        {
            msg = "<script language='javascript'>alert('" + GetTran("000300", "请选择地址!") + "')</script>";
            return;
        }
        if (this.CountryCity1.Province == "请选择")
        {
            msg = "<script language='javascript'>alert('" + GetTran("000300", "请选择地址!") + "')</script>";
            return;
        }
        if (this.CountryCity1.City == "请选择")
        {
            msg = "<script language='javascript'>alert('" + GetTran("000300", "请选择地址!") + "')</script>";
            return;
        }
        #endregion

        #region   图片
        string dirName     = "";
        string oldFilePath = "";// this.PhotoPath.PostedFile.FileName.Trim();
        string oldFileName = "";
        string newFileName = "";

        int photoW = 0, photoH = 0;
        //try
        //{
        //    if (oldFilePath != string.Empty)
        //    {
        //        //如果是编辑则删除旧图
        //        if (ViewState["PhotoPath"].ToString() != string.Empty)
        //        {
        //            if (System.IO.File.Exists(Server.MapPath("../upload/" + ViewState["PhotoPath"].ToString())))
        //            {
        //                System.IO.File.Delete(Server.MapPath("../upload/" + ViewState["PhotoPath"].ToString()));
        //            }
        //        }
        //        //检查目录是否存在
        //        dirName = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString();
        //        //if (!System.IO.Directory.Exists(Server.MapPath("../upload/" + dirName)))
        //        //{
        //        //    System.IO.Directory.CreateDirectory(Server.MapPath("../upload/" + dirName));
        //        //}

        //        oldFileName = System.IO.Path.GetFileName(oldFilePath);

        //        string fileExtName = System.IO.Path.GetExtension(oldFilePath);
        //        if (fileExtName.ToLower() != ".gif" && fileExtName.ToLower() != ".jpg" && fileExtName.ToLower() != ".jpeg")
        //        {
        //            Response.Write("<script>alert('" + GetTran("000823", "上传文件格式不正确!") + "');</script>");
        //            return;
        //        }
        //        if (this.PhotoPath.PostedFile.ContentLength > 51200)
        //        {
        //            Response.Write("<script>alert('" + GetTran("000824", "上传文件不能大于50K!") + "');</script>");
        //            return;
        //        }
        //        System.Random rd = new Random(0);
        //        newFileName = DateTime.Now.Year.ToString() + rd.Next(10).ToString()
        //            + DateTime.Now.Month.ToString() + rd.Next(10).ToString()
        //            + DateTime.Now.Day.ToString() + rd.Next(10).ToString()
        //            + DateTime.Now.Second.ToString()
        //            + fileExtName;

        //       // string newFilePath = Server.MapPath("..\\upload\\" + dirName) + "\\" + newFileName;
        //       // string newFilePath = Server.MapPath("..\\upload\\") + "\\" + newFileName;
        //        string newFilePath = Server.MapPath("..\\upload\\") + newFileName;
        //        this.PhotoPath.PostedFile.SaveAs(newFilePath);
        //        try
        //        {
        //            System.Drawing.Image myIma = System.Drawing.Image.FromFile(newFilePath);
        //            photoH = myIma.Height;
        //            photoW = myIma.Width;

        //        }
        //        catch
        //        { }
        //    }
        //}
        //catch (Exception ext)
        //{
        //    msg = "<script>alert('" + ext.Message + "')</script>";
        //    return;
        //}

        #endregion

        StoreInfoModel storeInfoMember = new StoreInfoModel();
        storeInfoMember.Number    = this.Number.Text.ToString();
        storeInfoMember.Name      = Encryption.Encryption.GetEncryptionName(this.Name.Text.ToString());
        storeInfoMember.StoreID   = this.StoreID.Text.ToString();
        storeInfoMember.StoreName = Encryption.Encryption.GetEncryptionName(this.StoreName.Text.ToString());

        storeInfoMember.StoreAddress = Encryption.Encryption.GetEncryptionAddress(this.Address.Text.ToString());
        storeInfoMember.HomeTele     = Encryption.Encryption.GetEncryptionTele(this.HomeTele.Text.ToString());
        storeInfoMember.OfficeTele   = Encryption.Encryption.GetEncryptionTele(this.OfficeTele.Text.ToString());
        storeInfoMember.FaxTele      = Encryption.Encryption.GetEncryptionTele(this.FaxTele.Text.ToString());
        storeInfoMember.MobileTele   = Encryption.Encryption.GetEncryptionTele(this.MobileTele.Text.ToString());

        string cp1 = this.MemberBank1.SelectedValue.ToString();
        storeInfoMember.BankCode       = cp1.ToString();
        storeInfoMember.BankCard       = Encryption.Encryption.GetEncryptionCard(this.BankCard.Text.ToString());
        storeInfoMember.Bankbranchname = txtEbank.Text.Trim();
        storeInfoMember.Email          = this.Email.Text.ToString();
        storeInfoMember.NetAddress     = this.NetAddress.Text.ToString();
        storeInfoMember.Remark         = this.Remark.Text.ToString();

        storeInfoMember.Direct        = this.Label1.Text.ToString();
        storeInfoMember.ExpectNum     = Convert.ToInt32(this.ExpectNum.Text.ToString());
        storeInfoMember.RegisterDate  = dt1.ToUniversalTime();
        storeInfoMember.StoreLevelInt = Convert.ToInt32(this.StoreLevelInt.SelectedItem.Value.ToString());
        //storeInfoMember.StoreLevelStr = this.StoreLevelInt.SelectedItem.Value.ToString();

        storeInfoMember.FareArea         = FareArea;
        storeInfoMember.TotalInvestMoney = TotalInvestMoney;
        storeInfoMember.PostalCode       = this.PostolCode.Text.ToString();

        storeInfoMember.Language   = Convert.ToInt32(this.Language.Text.ToString());
        storeInfoMember.OperateIp  = CommonDataBLL.OperateIP;
        storeInfoMember.OperateNum = CommonDataBLL.OperateBh;
        storeInfoMember.ID         = Convert.ToInt32(ViewState["id"]);
        string cp = DBHelper.ExecuteScalar("select cpccode from city where country='" + this.CountryCity1.Country + "' and province='" + this.CountryCity1.Province + "' and city='" + this.CountryCity1.City + "' and xian='" + this.CountryCity1.Xian + "'").ToString();
        storeInfoMember.CPCCode = cp.ToString();
        //if (this.PhotoPath.PostedFile.FileName.Trim() != string.Empty)
        //{
        //    //storeInfoMember.PhotoPath  = dirName + "\\" + newFileName;
        //    storeInfoMember.PhotoPath =  "upload/"+newFileName;
        //}
        //else
        //{
        storeInfoMember.PhotoPath = "";// ViewState["Image"].ToString();
        //}
        // storeInfoMember.PhotoH = photoH;
        //  storeInfoMember.PhotoW = photoW;
        int i = 0;
        BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("storeinfo", "(ltrim(rtrim(id)))");
        cl_h_info.AddRecord(Convert.ToInt32(ViewState["id"]));//不能放到事务中  数据前
        i = sieb.updateStore(storeInfoMember);

        if (i > 0)
        {
            cl_h_info.AddRecord(Convert.ToInt32(ViewState["id"]));                                                                                         //不能放到事务中  修改数据后
            cl_h_info.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.company4, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype2); //不能放到事务中

            msg = "<script language='javascript'>alert('" + GetTran("000222", "修改成功!") + "');location.href='StoreInfoModify.aspx'</script>";
        }
        else
        {
            msg = "<script language='javascript'>alert('" + GetTran("000225", "修改失败!") + "');location.href='StoreInfoModify.aspx'</script>";
        }
    }
Example #27
0
    /// <summary>
    /// 执行修改方法
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void BtnUpt_Click(object sender, EventArgs e)
    {
        int id = (int)(ViewState["id"] != null ? ViewState["id"] : 0);

        if (id <= 0)
        {
            ScriptHelper.SetAlert((Control)sender, GetTran("001102", "异常访问!"), "ManagerManage.aspx");
            return;
        }
        ManageModel manager = null;

        manager = ManagerBLL.GetManage(id);
        if (manager == null)
        {
            ScriptHelper.SetAlert((Control)sender, GetTran("001102", "异常访问!"), "ManagerManage.aspx");
            return;
        }
        //取出当前登录管理员的编号
        string manageId = BLL.CommonClass.CommonDataBLL.getManageID(1);

        if (manager.Number.ToString().Trim() == manageId)
        {
            ScriptHelper.SetAlert(Page, GetTran("001106", "不允许修改该管理员!"), "ManagerManage.aspx");
            return;
        }
        //验证必填信息
        if (this.ddlRoles.Text.Trim() == "")
        {
            ScriptHelper.SetAlert((Control)sender, GetTran("001113", "角色信息不能为空"));
            return;
        }

        if (this.ddlDepts.Text.Trim() == "")
        {
            ScriptHelper.SetAlert((Control)sender, GetTran("001114", "部门信息不能为空"));
            return;
        }

        if (this.txtName.Text.Trim() == "")
        {
            ScriptHelper.SetAlert((Control)sender, GetTran("001116", "管理员姓名不能为空"));
            return;
        }

        if (this.txtNumber.Text.Trim() == "")
        {
            ScriptHelper.SetAlert((Control)sender, GetTran("001117", "管理员编号不能为空"));
            return;
        }
        string number = Session["Company"].ToString();

        if (number != manageId)
        {
            if (!DeptRoleBLL.CheckAllot(number, int.Parse(this.ddlRoles.SelectedValue)))
            {
                ScriptHelper.SetAlert((Control)sender, GetTran("000975", "不能对该角色进行操作,没有权限!"));
                return;
            }
        }
        //验证角色信息
        CheckDeptRole();
        //验证部门信息
        CheckCompanyDept();
        //需要验证角色名是否重复
        if (manager.Number.Trim() != txtNumber.Text.Trim())
        {
            if (!ManagerBLL.CheckNumber(txtNumber.Text.Trim()))
            {
                ScriptHelper.SetAlert((Control)sender, GetTran("001118", "当前管理员编号已经存在!"));
                return;
            }
        }
        //根据输入信息构建管理员

        manager.Number            = this.txtNumber.Text.Trim();
        manager.Name              = txtName.Text.Trim();
        manager.Post              = this.ddlRoles.SelectedItem.Text.Trim();
        manager.Branch            = this.ddlDepts.SelectedItem.Text.Trim();
        manager.RoleID            = int.Parse(this.ddlRoles.SelectedValue);
        manager.Status            = 1;
        manager.IsViewPermissions = int.Parse(this.RadioButtonList1.SelectedValue);
        manager.IsRecommended     = int.Parse(this.RadioButtonList2.SelectedValue);
        //存储管理员信息到数据库

        BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("manage", "id");
        cl.AddRecord(id);
        if (ManagerBLL.UptManage(manager))
        {
            //存储成功,给出提示ChangeCategory
            cl.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.company26, GetTran("001082", "管理员:") + manager.Name, BLL.CommonClass.ENUM_USERTYPE.objecttype7);
            ScriptHelper.SetAlert((Control)sender, GetTran("001119", "修改管理员成功!"), "ManagerManage.aspx");
        }
        else
        {
            //存储失败,给出提示

            ScriptHelper.SetAlert((Control)sender, GetTran("001121", "修改管理员失败!"));
        }
    }
Example #28
0
    protected void go_Click(object sender, System.EventArgs e)
    {
        //删除会员图片
        string dirName = "";
        string oldFileName = "";
        string newFileName = "";
        string newFilePath = "";
        int    photoW = 0, photoH = 0;

        #region
        //if (this.myFile.PostedFile.FileName.Trim() != string.Empty)
        //{
        //    //删除旧图
        //    if (Session["Member"].ToString() != "")
        //    {
        //        delMemberPic(Session["Member"].ToString());
        //    }
        //    else
        //    {
        //        //Response.Write("<script>alert('参数错误,请重新登陆!');location.href('index.aspx')</script>");
        //        msg = "<script language='javascript'>alert('参数错误!重新登陆!');location.href('../index.aspx')</script>";
        //        return;
        //    }
        //    #region 上传新图

        //    //string oldFilePath = this.myFile.PostedFile.FileName.Trim();

        //    //try
        //    //{
        //    //    if (oldFilePath != string.Empty)
        //    //    {
        //    //        //检查目录是否存在
        //    //        dirName = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString();
        //    //        if (!System.IO.Directory.Exists(Server.MapPath("../upload/" + dirName)))
        //    //        {
        //    //            System.IO.Directory.CreateDirectory(Server.MapPath("../upload/" + dirName));
        //    //        }

        //    //        oldFileName = System.IO.Path.GetFileName(oldFilePath);

        //    //        string fileExtName = System.IO.Path.GetExtension(oldFilePath);
        //    //        if (fileExtName.ToLower() != ".gif" && fileExtName.ToLower() != ".jpg" && fileExtName.ToLower() != ".jpeg")
        //    //        {
        //    //           // Response.Write("<script>alert('上传文件格式不正确!')</script>");
        //    //            msg = "<script language='javascript'>alert('上传文件格式不正确!');</script>";
        //    //            return;
        //    //        }
        //    //        if (myFile.PostedFile.ContentLength > 102400)
        //    //        {
        //    //            //Response.Write("<script>alert('上传文件不能大于100K!')</script>");
        //    //            msg = "<script language='javascript'>alert('上传文件不能大于100K!');</script>";
        //    //            return;
        //    //        }

        //    //        System.Random rd = new Random(0);
        //    //        newFileName = DateTime.Now.Year.ToString() + rd.Next(10).ToString()
        //    //            + DateTime.Now.Month.ToString() + rd.Next(10).ToString()
        //    //            + DateTime.Now.Day.ToString() + rd.Next(10).ToString()
        //    //            + DateTime.Now.Second.ToString()
        //    //            + fileExtName;

        //    //        newFilePath = Server.MapPath("..\\upload\\" + dirName) + "\\" + newFileName;
        //    //        this.myFile.PostedFile.SaveAs(newFilePath);

        //    //        try
        //    //        {
        //    //            System.Drawing.Image myIma = System.Drawing.Image.FromFile(newFilePath);
        //    //            photoH = myIma.Height;
        //    //            photoW = myIma.Width;

        //    //        }
        //    //        catch
        //    //        { }

        //    //        ViewState["photopath"] = dirName + "\\" + newFileName;
        //    //        ViewState["photoH"] = photoH.ToString();
        //    //        ViewState["photoW"] = photoW.ToString();

        //    //    }
        //    //}
        //    //catch (Exception ext)
        //    //{
        //    //    Response.Write("<script>alert('" + ext.ToString() + "')</script>");
        //    //    return;
        //    //}
        //    #endregion
        //    #region 上传图片
        //    string oldFilePath = this.myFile.PostedFile.FileName.Trim();
        //    //string oldFilePath = "";

        //    try
        //    {
        //        if (oldFilePath != string.Empty)
        //        {
        //            if (!Directory.Exists(Server.MapPath("../Store/H_image"))) //如果文件夹不存在则创建
        //            {
        //                Directory.CreateDirectory(Server.MapPath("../Store/H_image"));
        //            }

        //            //检查目录是否存在
        //            dirName = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString();

        //            oldFileName = System.IO.Path.GetFileName(oldFilePath);

        //            string fileExtName = System.IO.Path.GetExtension(oldFilePath);
        //            if (fileExtName.ToLower() != ".gif" && fileExtName.ToLower() != ".jpg" && fileExtName.ToLower() != ".jpeg" && fileExtName.ToLower() != ".bmp" && fileExtName.ToLower() != ".png")
        //            {
        //                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000823", "上传文件格式不正确!") + "');", true);
        //                return;
        //            }
        //            if (this.myFile.PostedFile.ContentLength > 51200)
        //            {
        //                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000824", "上传文件不能大于50K!") + "');", true);
        //                return;
        //            }
        //            //System.Drawing.Image img = System.Drawing.Image.FromStream(PhotoPath1.PostedFile.InputStream);
        //            //int width = img.Width;
        //            //int hight = img.Height;
        //            //if (width > 50 || hight > 50)
        //            //{
        //            //    Response.Write("<script>alert('" + GetTran("006034", "图片宽度和高度太大!") + "');</script>");
        //            //    this.Button1.Enabled = true;
        //            //    return "";
        //            //}
        //            System.Random rd = new Random(0);
        //            newFileName = DateTime.Now.Year.ToString() + rd.Next(10).ToString()
        //                + DateTime.Now.Month.ToString() + rd.Next(10).ToString()
        //                + DateTime.Now.Day.ToString() + rd.Next(10).ToString()
        //                + DateTime.Now.Second.ToString()
        //                + fileExtName;
        //            newFilePath = Server.MapPath("..\\Store\\H_image\\") + newFileName;

        //            string LevelIcon = "../Store/" + new MemberInfoModifyBll().GetMemberPhoto(Session["Member"].ToString());
        //            if (System.IO.File.Exists(Server.MapPath(LevelIcon)))
        //            {
        //                System.IO.File.Delete(Server.MapPath(LevelIcon));
        //            }

        //            this.myFile.PostedFile.SaveAs(newFilePath);
        //            try
        //            {
        //                System.Drawing.Image myIma = System.Drawing.Image.FromFile(newFilePath);
        //                photoH = myIma.Height;
        //                photoW = myIma.Width;

        //            }
        //            catch
        //            { }
        //            filepath = @"\Store\H_image\" + newFileName;
        //            try
        //            {
        //                System.Drawing.Image myIma = System.Drawing.Image.FromFile(newFilePath);
        //                photoH = myIma.Height;
        //                photoW = myIma.Width;

        //            }
        //            catch (Exception ex1)
        //            {
        //                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("006895", "图片格式转换错误!") + "');", true);
        //                if (System.IO.File.Exists(Server.MapPath(filepath)))
        //                {
        //                    System.IO.File.Delete(Server.MapPath(filepath));
        //                }
        //                return;
        //            }
        //        }
        //    }
        //    catch
        //    {
        //        return;
        //    }
        //    #endregion
        //}
        //else
        //{
        //}
        #endregion
        //生日
        DateTime birthday;
        try
        {
            //更改至标准时间
            birthday = Convert.ToDateTime(lblBirthday.Text);
        }
        catch
        {
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('" + GetTran("000148", "对不起,请选择正确的出生日期!") + "');</script>", false);
            return;
        }
        int sex = 0;
        if (labSex.Text.Trim() == GetTran("000094", "男"))
        {
            sex = 1;
        }
        else
        {
            sex = 0;
        }

        if (Txtbz.Text.Length > 500)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('" + GetTran("007704", "备注内容不能超过500字") + "!');</script>", false);
            return;
        }
        //姓名加密
        string name    = Encryption.Encryption.GetEncryptionName(labName.Text.Trim());
        string Petname = Txtlm.Text.Trim();
        //string Birthday = birthday;
        //string sex = sex;
        //加密电话

        string HomeTele = Encryption.Encryption.GetEncryptionTele(Txtjtdh.Text.Trim());

        string OfficeTele = Encryption.Encryption.GetEncryptionTele(Txtbgdh.Text.Trim());

        string MobileTele = Encryption.Encryption.GetEncryptionTele(Txtyddh.Text.Trim());

        string FaxTele = Encryption.Encryption.GetEncryptionTele(Txtczdh.Text.Trim());

        UserControl_CountryCity countrycity = Page.FindControl("CountryCity1") as UserControl_CountryCity;
        string Country  = countrycity.Country;
        string Province = countrycity.Province;
        string City     = countrycity.City;
        string Xian     = countrycity.Xian;
        if (Country == "请选择" || Province == "请选择" || City == "请选择" || Xian == "请选择" || Country == "" || Province == "" || City == "" || Xian == "")
        {
            ScriptHelper.SetAlert(Page, "请选择地址!");
            return;
        }
        string CPCCode = DAL.CommonDataDAL.GetCPCCode(Country, Province, City, Xian);
        //加密地址
        string Address = Encryption.Encryption.GetEncryptionAddress(txtdizhi.Text.Trim());
        if (Address.Trim().Length == 0)
        {
            ScriptHelper.SetAlert(Page, "请填写详细地址!");
            return;
        }

        string PostalCode = Txtyb1.Text.Trim();

        string PaperType = new GroupRegisterBLL().GetPaperTypeCode(lblzhengjian.Text.Trim());
        //证件加密
        string PaperNumber = Encryption.Encryption.GetEncryptionNumber(labzhengjianhaoma.Text.Trim());
        if (this.Txtbz.Text.Length > 500)
        {
            System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("006708", "对不起,备注输入的字符太多,最多500个字符!") + "');", true);
            return;
        }
        ;
        string Remark = Txtbz.Text.Trim();
        //int Healthy = Convert.ToInt32(MemberHealth.SelectedValue);
        string photopath = "";
        //需要修改标准时间
        DateTime Birthday = Convert.ToDateTime(birthday);

        #region 银行信息

        UserControl_CountryCity countrycity1 = Page.FindControl("CountryCity2") as UserControl_CountryCity;
        string Country1  = countrycity1.Country;
        string Province1 = countrycity1.Province;
        string City1     = countrycity1.City;
        string Xian1     = countrycity1.Xian;
        if (Country1 == "请选择" || Province1 == "请选择" || City1 == "请选择" || Xian1 == "请选择" || Country1 == "" || Province1 == "" || City1 == "" || Xian1 == "")
        {
            ScriptHelper.SetAlert(Page, "请选择开户行地址!");
            return;
        }
        string bcpccode      = DAL.CommonDataDAL.GetCPCCode(Country1, Province1, City1, Xian1);
        string bankcode      = DdlBank.SelectedValue;
        string bankbrachname = txtbankbrachname.Text.Trim();
        string bankcard      = Encryption.Encryption.GetEncryptionCard(labkahao.Text.Trim());
        string bankaddress   = "";

        #endregion

        BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("Memberinfo", "ltrim(rtrim(number))");
        cl_h_info.AddRecord(Session["Member"].ToString());
        MemberInfoModifyBll mf = new MemberInfoModifyBll();
        if (mf.updateMember(Session["Member"].ToString(), name, Petname, Birthday, sex, HomeTele, OfficeTele, MobileTele, FaxTele, Country, Province, City, Address, PostalCode, PaperType, PaperNumber, Remark, photopath, photoW, photoH, CPCCode, bcpccode, bankaddress, bankcard, bankcode, bankbrachname))
        {
            cl_h_info.AddRecord(Session["Member"].ToString());
            cl_h_info.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.member3, Session["Member"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype5);
            //ScriptHelper.SetAlert(Page,"修改成功!!!");
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('" + GetTran("000222", "修改成功!") + "');</script>", false);
        }
        else
        {
            //ScriptHelper.SetAlert(Page, "修改失败!!!");
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('" + GetTran("000225", "修改失败!") + "');</script>", false);
        }
        GetOldMemberData(Session["Member"].ToString());
    }
Example #29
0
    /// <summary>
    /// 提交事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        ///给单据模型层赋值
        bool TrueOrFalse = SetValueDocTypeTable();

        if (TrueOrFalse)
        {
            if ((int)ViewState["ID"] == 1)
            {
                ///获取指定单据类型的行数
                int getCount = SetParametersBLL.GetDocTypeTableCountByName(txtDocTypeName.Text.Trim());
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005403", "该单据类型已经存在!")));
                }

                else
                {
                    ///添加单据类型信息
                    int addCount = SetParametersBLL.AddDocTypeTable(docTypeTableModel);
                    if (addCount > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005404", "添加单据类型成功!")));
                        divDocTypeTable.Visible = false;
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005405", "添加单据类型失败,请联系管理员!")));
                    }
                }
            }

            if ((int)ViewState["ID"] == 2)
            {
                ///获取指定单据类型的行数
                int getCount = SetParametersBLL.GetDocTypeTableCountByIDName(Convert.ToInt32(ViewState["DocTypeID"]), txtDocTypeName.Text.Trim());
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005403", "该单据类型已经存在!")));
                }

                else
                {
                    BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("DocTypeTable", "DocTypeID");
                    cl_h_info.AddRecord(docTypeTableModel.DocTypeID);
                    ///修改指定单据类型信息
                    int updCount = SetParametersBLL.UpdDocTypeTableByID(docTypeTableModel);
                    if (updCount > 0)
                    {
                        cl_h_info.AddRecord(docTypeTableModel.DocTypeID);
                        cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);

                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005406", "修改单据类型成功!")));
                        divDocTypeTable.Visible = false;
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005407", "修改单据类型失败,请联系管理员!")));
                        return;
                    }
                }
            }
            DataBindDocTypeTable();
        }

        else
        {
            return;
        }
    }
Example #30
0
    /// <summary>
    /// 提交事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        int  value = 0;
        bool flag  = SetValueProductColorModel();

        if (flag)
        {
            if ((int)ViewState["ID"] == 1)
            {
                //获取指定产品颜色的行数
                int getCount = SetParametersBLL.GetProductColorCountByName(txtProductColorName.Text.Trim());
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002201", "该颜色已经存在!")));
                }

                else
                {
                    //添加颜色信息
                    using (SqlConnection conn = new SqlConnection(DBHelper.connString))
                    {
                        int id;
                        conn.Open();

                        try
                        {
                            value = SetParametersBLL.AddProductColor(productColorModel, out id);
                            language.AddNewTranslationRecord("ProductColor", "ProductColorName", id, txtProductColorName.Text.Trim(), txtProductColorName.Text.Trim());
                            language.AddNewTranslationRecord("ProductColor", "ProductColorDescr", id, txtProductColorDescr.Text.Trim(), txtProductColorDescr.Text.Trim());
                        }

                        catch (Exception ex)
                        {
                            value = 0;

                            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002203", "添加颜色失败,请联系管理员!")));
                        }
                        if (value > 0)
                        {
                            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002202", "添加颜色成功!")));
                            divProductColor.Visible = false;
                        }
                    }
                }
            }

            if ((int)ViewState["ID"] == 2)
            {
                int updCount = 0;
                ///获取指定产品颜色的行数
                int getCount = SetParametersBLL.GetProductColorCountByIDName(Convert.ToInt32(ViewState["ProductColorID"]), txtProductColorName.Text.Trim());
                if (getCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002201", "该颜色已经存在!")));
                }

                else
                {
                    BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductColor", "ProductColorID");
                    cl_h_info.AddRecord(productColorModel.ProductColorID);


                    using (SqlConnection conn = new SqlConnection(DBHelper.connString))
                    {
                        conn.Open();
                        using (SqlTransaction tran = conn.BeginTransaction())
                        {
                            try
                            {
                                ///修改指定产品颜色信息
                                value = SetParametersBLL.UpdProductColorByID(tran, productColorModel);
                                language.UpdateNewTranslationRecord(tran, "ProductColor", "ProductColorName", Convert.ToInt32(ViewState["ProductColorID"]), productColorModel.ProductColorName);
                                language.UpdateNewTranslationRecord(tran, "ProductColor", "ProductColorDescr", Convert.ToInt32(ViewState["ProductColorID"]), productColorModel.ProductColorDescr);
                                tran.Commit();
                            }
                            catch (Exception ex)
                            {
                                value = 0;
                                tran.Rollback();
                                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002208", "修改颜色失败,请联系管理员!")));
                            }
                            if (value > 0)
                            {
                                cl_h_info.AddRecord(productColorModel.ProductColorID);
                                cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9);
                                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002205", "修改颜色成功!")));
                                divProductColor.Visible = false;
                            }
                        }
                    }
                }
            }
            DataBindProductColor();
        }

        else
        {
            return;
        }
    }