public virtual CloudAccountDA.MasterAdminRightsMasterDataTable GetData()
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     CloudAccountDA.MasterAdminRightsMasterDataTable dataTable = new CloudAccountDA.MasterAdminRightsMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
 public virtual int Fill(CloudAccountDA.MasterAdminRightsMasterDataTable dataTable)
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if (this.ClearBeforeFill)
     {
         dataTable.Clear();
     }
     return(this.Adapter.Fill(dataTable));
 }
 public virtual CloudAccountDA.MasterAdminRightsMasterDataTable DeleteByMasterAdmin(int?MasterAdminID)
 {
     this.Adapter.SelectCommand = this.CommandCollection[1];
     if (MasterAdminID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = MasterAdminID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     CloudAccountDA.MasterAdminRightsMasterDataTable dataTable = new CloudAccountDA.MasterAdminRightsMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
 private void ViewRecord(string empID)
 {
     this.objMasterAdminUserRightsMasterDT = this.objMasterAdminUserRightsMasterBll.GetDataByViewRecords(int.Parse(empID));
     if (this.objMasterAdminUserRightsMasterDT.Rows.Count <= 0)
     {
         return;
     }
     this.ddlMasterAdmin.SelectedValue = this.objMasterAdminUserRightsMasterDT.Rows[0]["MasterAdminID"].ToString();
     this.ddlMasterAdmin.DataBind();
     this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?());
     if (this.objFormGridMasterDT.Rows.Count <= 0)
     {
         return;
     }
     this.gvForm.DataSource = (object)this.objFormGridMasterDT;
     this.gvForm.DataBind();
     this.gvForm.Enabled  = false;
     this.btnEdit.Visible = false;
 }
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     this.objMasterAdminUserRightsMasterDT = this.objMasterAdminUserRightsMasterBll.GetDataBySelectRightsDetails(int.Parse(this.ddlMasterAdmin.SelectedValue.Trim()), int.Parse(this.ddlModule.SelectedValue.Trim()));
     if (this.objMasterAdminUserRightsMasterDT.Rows.Count > 0)
     {
         this.DisplayAlert("User Rights Already Entered.");
     }
     else if (this.ddlMasterAdmin.SelectedValue != "0" && this.ddlModule.SelectedValue != "0")
     {
         for (int index = 0; index < this.gvForm.Rows.Count; ++index)
         {
             if (this.objMasterAdminUserRightsMasterBll.AddMasterAdminRights(int.Parse(this.ddlMasterAdmin.SelectedValue.Trim()), int.Parse(this.ddlModule.SelectedValue.Trim()), int.Parse(((Label)this.gvForm.Rows[index].FindControl("lblFormID")).Text), ((Label)this.gvForm.Rows[index].FindControl("lblFormName")).Text.Trim(), ((CheckBox)this.gvForm.Rows[index].FindControl("chkAdd")).Checked, ((CheckBox)this.gvForm.Rows[index].FindControl("chkEdit")).Checked, ((CheckBox)this.gvForm.Rows[index].FindControl("chkDelete")).Checked, ((CheckBox)this.gvForm.Rows[index].FindControl("chkView")).Checked) == 0)
             {
                 this.DisplayAlert("Fail to Add New Details.");
             }
         }
         this.Response.Redirect("~/BillTransact/MasterAdminRightsMaster.aspx?cmd=view&ID=&MasterAdminID=" + this.ddlMasterAdmin.SelectedValue.Trim() + "&ModuleID=" + this.ddlModule.SelectedValue.Trim());
     }
     else
     {
         this.DisplayAlert("Please Enter All Details.");
     }
 }
 public virtual CloudAccountDA.MasterAdminRightsMasterDataTable GetDataByViewPageRights(int?MasterAdminID, string ModuleFormName)
 {
     this.Adapter.SelectCommand = this.CommandCollection[4];
     if (MasterAdminID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = MasterAdminID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (ModuleFormName == null)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = ModuleFormName;
     }
     CloudAccountDA.MasterAdminRightsMasterDataTable dataTable = new CloudAccountDA.MasterAdminRightsMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
 public virtual CloudAccountDA.MasterAdminRightsMasterDataTable GetDataByRightsDetails(int?MasterAdminID, int?ModuleID)
 {
     this.Adapter.SelectCommand = this.CommandCollection[3];
     if (MasterAdminID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = MasterAdminID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (ModuleID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = ModuleID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     CloudAccountDA.MasterAdminRightsMasterDataTable dataTable = new CloudAccountDA.MasterAdminRightsMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
 private void SetRecord(string empID, string mID)
 {
     if (MasterAdminRightsMaster.AddMode == "Edit")
     {
         this.objMasterAdminUserRightsMasterDT = this.objMasterAdminUserRightsMasterBll.GetDataBySelectRightsDetails(int.Parse(empID), int.Parse(mID));
         if (this.objMasterAdminUserRightsMasterDT.Rows.Count <= 0)
         {
             return;
         }
         this.ddlMasterAdmin.SelectedValue = this.objMasterAdminUserRightsMasterDT.Rows[0]["MasterAdminID"].ToString();
         this.ddlMasterAdmin.DataBind();
         this.ddlModule.SelectedValue = this.objMasterAdminUserRightsMasterDT.Rows[0]["ModuleID"].ToString();
         this.ddlModule.DataBind();
         this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?());
         this.gvForm.DataSource   = (object)this.objMasterAdminUserRightsMasterDT;
         this.gvForm.DataBind();
         this.gvForm.Enabled  = false;
         this.btnEdit.Visible = true;
     }
     else
     {
         this.objMasterAdminUserRightsMasterDT = this.objMasterAdminUserRightsMasterBll.GetDataBySelectRightsDetails(int.Parse(empID), int.Parse(mID));
         if (this.objMasterAdminUserRightsMasterDT.Rows.Count <= 0)
         {
             return;
         }
         this.ddlMasterAdmin.SelectedValue = this.objMasterAdminUserRightsMasterDT.Rows[0]["MasterAdminID"].ToString();
         this.ddlMasterAdmin.DataBind();
         this.ddlModule.SelectedValue = this.objMasterAdminUserRightsMasterDT.Rows[0]["ModuleID"].ToString();
         this.ddlModule.DataBind();
         this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?());
         this.gvForm.DataSource   = (object)this.objMasterAdminUserRightsMasterDT;
         this.gvForm.DataBind();
         this.gvForm.Enabled  = true;
         this.btnEdit.Visible = true;
     }
 }
 private void SubBindGrid()
 {
     if (MasterAdminRightsMaster.AddMode == "Edit")
     {
         string selectedValue = this.ddlModule.SelectedValue;
         if (string.IsNullOrEmpty(this.ddlModule.SelectedValue) && string.IsNullOrEmpty(this.ddlMasterAdmin.SelectedValue))
         {
             this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?());
             if (this.objFormGridMasterDT.Rows.Count <= 0)
             {
                 return;
             }
             this.gvForm.DataSource = (object)this.objFormGridMasterDT;
             this.gvForm.DataBind();
             this.gvForm.Enabled  = false;
             this.btnEdit.Visible = false;
         }
         else
         {
             this.objMasterAdminUserRightsMasterDT = this.objMasterAdminUserRightsMasterBll.GetDataBySelectRightsDetails(int.Parse(this.ddlMasterAdmin.SelectedValue.Trim()), int.Parse(this.ddlModule.SelectedValue.Trim()));
             if (this.objMasterAdminUserRightsMasterDT.Rows.Count > 0)
             {
                 this.gvForm.DataSource = (object)this.objMasterAdminUserRightsMasterDT;
                 this.gvForm.DataBind();
                 this.gvForm.Enabled  = false;
                 this.btnEdit.Visible = true;
             }
             else
             {
                 this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?(int.Parse(selectedValue)));
                 if (this.objFormGridMasterDT.Rows.Count > 0)
                 {
                     this.gvForm.DataSource = (object)this.objFormGridMasterDT;
                     this.gvForm.DataBind();
                     this.gvForm.Enabled  = false;
                     this.btnEdit.Visible = false;
                 }
                 else
                 {
                     this.gvForm.DataSource = (object)this.objFormGridMasterDT;
                     this.gvForm.DataBind();
                     this.btnEdit.Visible = false;
                 }
             }
         }
     }
     else
     {
         string selectedValue = this.ddlModule.SelectedValue;
         if (string.IsNullOrEmpty(this.ddlModule.SelectedValue) && string.IsNullOrEmpty(this.ddlMasterAdmin.SelectedValue))
         {
             this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?());
             if (this.objFormGridMasterDT.Rows.Count <= 0)
             {
                 return;
             }
             this.gvForm.DataSource = (object)this.objFormGridMasterDT;
             this.gvForm.Enabled    = false;
             this.btnSubmit.Visible = false;
             this.btnReset.Visible  = false;
             this.gvForm.DataBind();
         }
         else
         {
             this.objMasterAdminUserRightsMasterDT = this.objMasterAdminUserRightsMasterBll.GetDataBySelectRightsDetails(int.Parse(this.ddlMasterAdmin.SelectedValue.Trim()), int.Parse(this.ddlModule.SelectedValue.Trim()));
             if (this.objMasterAdminUserRightsMasterDT.Rows.Count > 0)
             {
                 this.gvForm.DataSource = (object)this.objMasterAdminUserRightsMasterDT;
                 this.gvForm.DataBind();
                 this.gvForm.Enabled    = false;
                 this.btnSubmit.Visible = false;
                 this.btnReset.Visible  = false;
             }
             else
             {
                 this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?(int.Parse(selectedValue)));
                 if (this.objFormGridMasterDT.Rows.Count > 0)
                 {
                     this.gvForm.DataSource = (object)this.objFormGridMasterDT;
                     this.gvForm.DataBind();
                     this.gvForm.Enabled    = true;
                     this.btnSubmit.Visible = true;
                     this.btnReset.Visible  = true;
                 }
                 else
                 {
                     this.gvForm.DataSource = (object)this.objFormGridMasterDT;
                     this.gvForm.DataBind();
                     this.btnSubmit.Visible = false;
                     this.btnReset.Visible  = false;
                 }
             }
         }
     }
 }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Master == null)
            {
                return;
            }
            ((HtmlControl)this.Master.FindControl("companyManagement")).Attributes.Add("class", "active open");
            ((HtmlControl)this.Master.FindControl("companyPackageInfo")).Attributes.Add("class", "active open");
            if (this.IsPostBack)
            {
                return;
            }
            if (Admin.RoleName != null)
            {
                MembershipUser user = Membership.GetUser();
                if (Admin.RoleName == "SuperAdmin")
                {
                    CompanyPackageInfo.ViewStatus = "True";
                    CompanyPackageInfo.AddStatus  = "True";
                }
                else if (Admin.RoleName == "MasterAdmin")
                {
                    if (user != null)
                    {
                        string str = user.ToString();
                        if (Roles.IsUserInRole(str, "MasterAdmin"))
                        {
                            this.objMasterAdminLoginMasterDT = this.objMasterAdminLoginMasterBll.GetDataByUserName(str);
                            if (this.objMasterAdminLoginMasterDT.Rows.Count > 0)
                            {
                                this.hfMasterAdminID.Value = this.objMasterAdminLoginMasterDT.Rows[0]["MasterAdminUserID"].ToString();
                            }
                        }
                    }
                    this.objMasterAdminRightsMasterDT = this.objMasterAdminRightsMasterBll.GetDataByViewPageRights(int.Parse(this.hfMasterAdminID.Value.Trim()), "CompanyPackageInfo");
                    CompanyPackageInfo.ViewStatus     = this.objMasterAdminRightsMasterDT.Rows.Count > 0 ? this.objMasterAdminRightsMasterDT.Rows[0]["ViewMode"].ToString() : "";
                    CompanyPackageInfo.AddStatus      = this.objMasterAdminRightsMasterDT.Rows.Count > 0 ? this.objMasterAdminRightsMasterDT.Rows[0]["AddMode"].ToString() : "";
                }
                else
                {
                    CompanyPackageInfo.ViewStatus = "";
                    CompanyPackageInfo.AddStatus  = "";
                }
            }
            if (CompanyPackageInfo.ViewStatus == "True")
            {
                if (this.Request.QueryString["cmd"] != null)
                {
                    switch (this.Request.QueryString["cmd"])
                    {
                    case "view":
                        if (this.Request.QueryString["ID"] == null || !(CompanyPackageInfo.ViewStatus == "True"))
                        {
                            break;
                        }
                        this.hfCompanyID.Value  = this.Request.QueryString["ID"];
                        this.pnlAdd.Visible     = false;
                        this.pnlViewAll.Visible = false;
                        this.pnlView.Visible    = true;
                        this.btnList.Visible    = true;
                        this.dlCompanyPackage.DataBind();
                        break;

                    case "add":
                        if (this.Request.QueryString["ID"] == null || !(CompanyPackageInfo.AddStatus == "True"))
                        {
                            break;
                        }
                        this.hfCompanyID.Value        = this.Request.QueryString["ID"];
                        this.pnlViewAll.Visible       = false;
                        this.pnlView.Visible          = false;
                        this.pnlAdd.Visible           = true;
                        this.ddlCompany.SelectedValue = this.hfCompanyID.Value;
                        if (string.IsNullOrEmpty(this.ddlCompany.SelectedValue))
                        {
                            this.Response.Redirect("CompanyPackageInfo.aspx");
                        }
                        this.ddlPackage.Focus();
                        break;

                    default:
                        this.BindGrid();
                        this.pnlViewAll.Visible = true;
                        this.pnlView.Visible    = false;
                        this.pnlAdd.Visible     = false;
                        break;
                    }
                }
                else
                {
                    this.BindGrid();
                    this.pnlViewAll.Visible = true;
                    this.pnlView.Visible    = false;
                    this.pnlAdd.Visible     = false;
                }
            }
            else
            {
                this.pnlViewAll.Visible = false;
                this.pnlView.Visible    = false;
                this.pnlAdd.Visible     = false;
            }
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Master == null)
            {
                return;
            }
            ((HtmlControl)this.Master.FindControl("generalMaster")).Attributes.Add("class", "active open");
            ((HtmlControl)this.Master.FindControl("bussiness")).Attributes.Add("class", "active open");
            if (this.IsPostBack)
            {
                return;
            }
            if (Admin.RoleName != null)
            {
                MembershipUser user = Membership.GetUser();
                if (Admin.RoleName == "SuperAdmin")
                {
                    BussinessMaster.AddStatus    = "True";
                    BussinessMaster.EditStatus   = "True";
                    BussinessMaster.ViewStatus   = "True";
                    BussinessMaster.DeleteStatus = "True";
                }
                else if (Admin.RoleName == "MasterAdmin")
                {
                    if (user != null)
                    {
                        string str = user.ToString();
                        if (Roles.IsUserInRole(str, "MasterAdmin"))
                        {
                            this.objMasterAdminLoginMasterDT = this.objMasterAdminLoginMasterBll.GetDataByUserName(str);
                            if (this.objMasterAdminLoginMasterDT.Rows.Count > 0)
                            {
                                this.hfMasterAdminID.Value = this.objMasterAdminLoginMasterDT.Rows[0]["MasterAdminUserID"].ToString();
                            }
                        }
                    }
                    this.objMasterAdminRightsMasterDT = this.objMasterAdminRightsMasterBll.GetDataByViewPageRights(int.Parse(this.hfMasterAdminID.Value.Trim()), "BussinessMaster");
                    if (this.objMasterAdminRightsMasterDT.Rows.Count > 0)
                    {
                        BussinessMaster.AddStatus    = this.objMasterAdminRightsMasterDT.Rows[0]["AddMode"].ToString();
                        BussinessMaster.EditStatus   = this.objMasterAdminRightsMasterDT.Rows[0]["EditMode"].ToString();
                        BussinessMaster.ViewStatus   = this.objMasterAdminRightsMasterDT.Rows[0]["ViewMode"].ToString();
                        BussinessMaster.DeleteStatus = this.objMasterAdminRightsMasterDT.Rows[0]["DeleteMode"].ToString();
                    }
                    else
                    {
                        BussinessMaster.AddStatus    = "";
                        BussinessMaster.EditStatus   = "";
                        BussinessMaster.ViewStatus   = "";
                        BussinessMaster.DeleteStatus = "";
                    }
                }
                else if (Admin.RoleName == "Admin")
                {
                    if (user != null)
                    {
                        string str = user.ToString();
                        if (Roles.IsUserInRole(str, "Admin"))
                        {
                            this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str);
                            if (this.objCompanyLoginMasterDT.Rows.Count > 0)
                            {
                                this.hfCompanyID.Value      = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString();
                                this.hfCompanyLoginID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyLoginID"].ToString();
                            }
                        }
                    }
                    this.objCompanyAdminRightsMasterDT = this.objCompanyAdminRightsMasterBll.GetDataByViewPageRights(int.Parse(this.hfCompanyID.Value.Trim()), int.Parse(this.hfCompanyLoginID.Value.Trim()), "BussinessMaster");
                    if (this.objCompanyAdminRightsMasterDT.Rows.Count > 0)
                    {
                        BussinessMaster.AddStatus    = this.objCompanyAdminRightsMasterDT.Rows[0]["AddMode"].ToString();
                        BussinessMaster.EditStatus   = this.objCompanyAdminRightsMasterDT.Rows[0]["EditMode"].ToString();
                        BussinessMaster.ViewStatus   = this.objCompanyAdminRightsMasterDT.Rows[0]["ViewMode"].ToString();
                        BussinessMaster.DeleteStatus = this.objCompanyAdminRightsMasterDT.Rows[0]["DeleteMode"].ToString();
                    }
                    else
                    {
                        BussinessMaster.AddStatus    = "";
                        BussinessMaster.EditStatus   = "";
                        BussinessMaster.ViewStatus   = "";
                        BussinessMaster.DeleteStatus = "";
                    }
                }
                else
                {
                    BussinessMaster.AddStatus    = "";
                    BussinessMaster.EditStatus   = "";
                    BussinessMaster.ViewStatus   = "";
                    BussinessMaster.DeleteStatus = "";
                }
            }
            if (BussinessMaster.ViewStatus == "True")
            {
                if (this.Request.QueryString["cmd"] != null)
                {
                    switch (this.Request.QueryString["cmd"])
                    {
                    case "view":
                        if (this.Request.QueryString["ID"] == null || !(BussinessMaster.ViewStatus == "True"))
                        {
                            break;
                        }
                        string i = this.Request.QueryString["ID"];
                        this.pnlViewAll.Visible = false;
                        this.pnlAdd.Visible     = false;
                        this.pnlView.Visible    = true;
                        this.ViewRecord(i);
                        this.btnEdit.Visible         = BussinessMaster.EditStatus == "True";
                        this.btnAddBussiness.Visible = this.btnAdd.Visible = BussinessMaster.AddStatus == "True";
                        this.btnDelete.Visible       = BussinessMaster.DeleteStatus == "True";
                        this.btnListAll.Visible      = true;
                        this.btnUpdate.Visible       = false;
                        this.btnCancel.Visible       = false;
                        break;

                    case "add":
                        if (this.Request.QueryString["ID"] != null)
                        {
                            if (!(BussinessMaster.EditStatus == "True"))
                            {
                                break;
                            }
                            this.SetRecord(this.Request.QueryString["ID"]);
                            this.pnlAdd.Visible     = true;
                            this.pnlViewAll.Visible = false;
                            this.pnlView.Visible    = false;
                            this.btnUpdate.Visible  = true;
                            this.btnCancel.Visible  = true;
                            this.btnSubmit.Visible  = false;
                            this.btnReset.Visible   = false;
                            break;
                        }
                        if (!(BussinessMaster.AddStatus == "True"))
                        {
                            break;
                        }
                        this.Clear();
                        this.btnSubmit.Visible  = true;
                        this.btnReset.Visible   = true;
                        this.btnUpdate.Visible  = false;
                        this.btnCancel.Visible  = false;
                        this.pnlAdd.Visible     = true;
                        this.pnlViewAll.Visible = false;
                        this.pnlView.Visible    = false;
                        break;

                    default:
                        this.BindGrid();
                        this.pnlViewAll.Visible = true;
                        this.pnlView.Visible    = false;
                        this.pnlAdd.Visible     = false;
                        break;
                    }
                }
                else
                {
                    this.BindGrid();
                    this.pnlViewAll.Visible = true;
                    this.pnlView.Visible    = false;
                    this.pnlAdd.Visible     = false;
                    if (BussinessMaster.AddStatus == "False")
                    {
                        this.btnAddBussiness.Visible = this.btnAdd.Visible = false;
                    }
                    else
                    {
                        this.btnAddBussiness.Visible = this.btnAdd.Visible = true;
                    }
                }
            }
            else if (BussinessMaster.AddStatus == "True" && BussinessMaster.EditStatus == "False" && (BussinessMaster.ViewStatus == "False" && BussinessMaster.DeleteStatus == "False"))
            {
                this.pnlAdd.Visible     = true;
                this.btnUpdate.Visible  = false;
                this.btnCancel.Visible  = false;
                this.pnlViewAll.Visible = false;
                this.pnlView.Visible    = false;
            }
            else
            {
                this.pnlViewAll.Visible = false;
                this.pnlView.Visible    = false;
                this.pnlAdd.Visible     = false;
            }
        }
 public virtual int Update(CloudAccountDA.MasterAdminRightsMasterDataTable dataTable)
 {
     return(this.Adapter.Update(dataTable));
 }