示例#1
0
        protected void grdUserGroup_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            Guid IDUserGroup = e.CommandArgument.ToString().StringToGuid();

            switch (e.CommandName)
            {
            case "Del":
                try
                {
                    ViewModel.tblUserGroup DeleteUserGroup = new ViewModel.tblUserGroup();
                    DeleteUserGroup.IDUserGroup = IDUserGroup;
                    bool ret = BisUserGroup.DeleteUserGroup(DeleteUserGroup);
                    if (ret)
                    {
                        fillGrdUserGroup(hfIdGroup.Value.StringToGuid());
                        NewFildsUserGroup();
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> حذف با موفقیت انجام شد!</p>\",title: \"<p style='text-align:right;direction:rtl'>حذف اطلاعات</p>\"});", true);
                    }
                }
                catch
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در برقراری ارتباط با دیتابیس!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true);
                }
                break;
            }
        }
示例#2
0
        protected void txtSort_TextChanged(object sender, EventArgs e)
        {
            try
            {
                GridViewRow row           = ((GridViewRow)((TextBox)sender).NamingContainer);
                int         index         = row.RowIndex;
                TextBox     txtSort       = (TextBox)grdUserGroup.Rows[index].FindControl("txtSort");
                HiddenField hfIDUserGroup = (HiddenField)grdUserGroup.Rows[index].FindControl("hfIDUserGroup");

                ViewModel.tblUserGroup update = new ViewModel.tblUserGroup();
                update.IDUserGroup = hfIDUserGroup.Value.StringToGuid();
                update.Sort        = txtSort.Text.StringToInt();
                bool ret = BisUserGroup.UpdateUserGroupBySort(update);
                if (ret)
                {
                    fillGrdUserGroup(hfIdGroup.Value.StringToGuid());
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در ثبت اولویت!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true);
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در برقراری ارتباط با دیتابیس!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true);
            }
        }
示例#3
0
        protected void btnAddUserGroup_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                if (PersonelAutoComplete.IDUser == "" || PersonelAutoComplete.IDUser == Guid.Empty.ToString())
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> لطفا کاربر مورد نظر را انتخاب کنید!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true);
                    return;
                }
                DataSet dsCheck = (DataSet)Session["dsUserGroup"];
                int     Check   = dsCheck.Tables[0].Select("IDUser='******'").Count();
                if (Check == 0)
                {
                    ViewModel.tblUserGroup newUserGroup = new ViewModel.tblUserGroup();
                    newUserGroup.IDUser  = PersonelAutoComplete.IDUser.StringToGuid();
                    newUserGroup.IDGroup = hfIdGroup.Value.StringToGuid();

                    try
                    {
                        newUserGroup.IDUserGroup = Guid.NewGuid();
                        bool ret = BisUserGroup.AddUserGroup(newUserGroup);
                        if (ret)
                        {
                            fillGrdUserGroup(hfIdGroup.Value.StringToGuid());
                            NewFildsUserGroup();
                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اطلاعات با موفقیت ثبت شد!</p>\",title: \"<p style='text-align:right;direction:rtl'>ثبت اطلاعات</p>\"});", true);
                        }
                        else
                        {
                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در ثبت اطلاعات!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true);
                        }
                    }
                    catch
                    {
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> اشکال در برقراری ارتباط با دیتابیس!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "Succsess", " bootbox.alert({message: \"<p dir='rtl' style='color:#004179;font-size:17px;'> این کاربر برای گروه " + lblModalGroupName.Text + " قبلا انتخاب شده است!</p>\",title: \"<p style='text-align:right;direction:rtl'>خطا</p>\"});", true);
                    NewFildsUserGroup();
                }
            }
        }
示例#4
0
 public bool DeleteUserGroup(ViewModel.tblUserGroup UserGroup)
 {
     return(sqlHelper.RunProcedure("sp_tblUserGroup_DeleteRow", UserGroup) > 0);
 }
示例#5
0
 public bool UpdateUserGroupBySort(ViewModel.tblUserGroup UserGroup)
 {
     return(sqlHelper.RunProcedure("sp_tblUserGroup_UpdateBySort", UserGroup) > 0);
 }
示例#6
0
 public bool AddUserGroup(ViewModel.tblUserGroup UserGroup)
 {
     return(sqlHelper.RunProcedure("sp_tblUserGroup_Insert", UserGroup) > 0);
 }