protected void BindRoleDetailsGridView(long RoleID)
 {
     try
     {
         CustomProfile profile = CustomProfile.GetProfile();
         //List<SP_GetDataToBindRoleMaster_Result> sessionList = new List<SP_GetDataToBindRoleMaster_Result>();Comment by vishal
         List <SP_GWCGetDataToBindRoleMaster_Result>      sessionList       = new List <SP_GWCGetDataToBindRoleMaster_Result>();
         BrilliantWMS.RoleMasterService.iRoleMasterClient roleMasterService = new BrilliantWMS.RoleMasterService.iRoleMasterClient();
         // sessionList = roleMasterService.GetDataToBindRoleMasterDetailsByRoleID(RoleID, profile.Personal.CompanyID, profile.DBConnection._constr).ToList();Comment by vishal
         sessionList = roleMasterService.GetGWCDataToBindRoleMasterDetailsByRoleID(RoleID, profile.Personal.CompanyID, profile.DBConnection._constr).ToList();// Added by vishal
         //GridRoleConfiguration.GroupBy = "DisplayModuleName,DisplayPhaseName";Comment by vishal
         GridRoleConfiguration.ShowHeader = true;
         GridRoleConfiguration.DataSource = sessionList;
         GridRoleConfiguration.DataBind();
         Session.Add("sessionRoleList", sessionList);
         roleMasterService.Close();
         //TabContainerRoleMaster.ActiveTabIndex = 1;
         //TabPanelRoleDetails.Visible = true;
     }
     catch (System.Exception ex)
     {
         Login.Profile.ErrorHandling(ex, this, "Role Master", "BindRoleDetailsGridView");
     }
     finally
     {
     }
 }
        protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            BrilliantWMS.RoleMasterService.iRoleMasterClient roleMasterService = new BrilliantWMS.RoleMasterService.iRoleMasterClient();
            try
            { if (checkDuplicate() == "")
              {
                  CustomProfile profile = CustomProfile.GetProfile();

                  mRole obj = new mRole();
                  if (hdnRoleID.Value != "0" && hdnRoleID.Value != string.Empty) // for edit
                  {
                      obj = roleMasterService.GetmRoleByID(Convert.ToInt32(hdnRoleID.Value), profile.DBConnection._constr);
                      obj.LastModifiedBy   = profile.Personal.UserID.ToString();
                      obj.LastModifiedDate = DateTime.Now;
                      obj.TerritoryID      = Convert.ToInt64(ddlDeartment.SelectedValue);
                  }
                  else //add new role
                  {
                      obj.CreatedBy    = profile.Personal.UserID.ToString();
                      obj.CreationDate = DateTime.Now;
                      obj.TerritoryID  = Convert.ToInt64(hdnSelectedDepartment.Value);
                  }
                  obj.RoleName = txtRoleName.Text.Trim();

                  obj.DepartmentID  = 1;
                  obj.CompanyID     = Convert.ToInt64(ddlcompany.SelectedValue);
                  obj.CommonValueID = Convert.ToInt64(ddlUserType.SelectedValue);

                  obj.DesignationID = 1;
                  obj.Sequence      = 0;
                  //if (txtSequence.Text != string.Empty) obj.Sequence = Convert.ToInt32(txtSequence.Text);
                  obj.Active = "Y";
                  if (rbtnNo.Checked == true)
                  {
                      obj.Active = "N";
                  }
                  //obj.CompanyID = profile.Personal.CompanyID;
                  // roleMasterService.FinalSave(getSessionList().ToArray(), obj, profile.DBConnection._constr);//Comment by vishal
                  roleMasterService.FinalSaveRole(getSessionList1().ToArray(), obj, profile.DBConnection._constr);
                  roleMasterService.Close();
                  TabContainerRoleMaster.ActiveTabIndex = 0;
                  TabPanelRoleDetails.Visible           = false;
                  BindRoleMasterGridView();
                  clear();
                  setActiveTab(0);
                  WebMsgBox.MsgBox.Show("Record saved successfully");
              }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Role Master", "pageSave");
            }
            finally
            {
            }
        }
 public string checkDuplicate()
 {
     BrilliantWMS.RoleMasterService.iRoleMasterClient roleMasterService = new BrilliantWMS.RoleMasterService.iRoleMasterClient();
     //PopupMessages.PopupMessage pop = new PopupMessages.PopupMessage();
     try
     {
         string        result  = "";
         CustomProfile profile = CustomProfile.GetProfile();
         if (hdnRoleID.Value == string.Empty)
         {
             result = roleMasterService.checkDuplicateRecord(txtRoleName.Text, profile.DBConnection._constr);
             if (result != string.Empty)
             {
                 WebMsgBox.MsgBox.Show(result);
                 txtRoleName.Text = "";
             }
             txtRoleName.Focus();
         }
         else
         {
             int id = Convert.ToInt32(hdnRoleID.Value);
             result = roleMasterService.checkDuplicateRecordEdit(id, txtRoleName.Text, profile.DBConnection._constr);
             if (result != string.Empty)
             {
                 WebMsgBox.MsgBox.Show(result);
                 txtRoleName.Text = "";
             }
         }
         return(result);
     }
     catch (System.Exception ex)
     {
         Login.Profile.ErrorHandling(ex, this, "Role Master", "checkDuplicate");
         string result = "";
         return(result);
     }
     finally
     {
         roleMasterService.Close();
     }
 }
        protected void BindRoleMasterGridView()
        {
            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                BrilliantWMS.RoleMasterService.iRoleMasterClient roleMasterService = new BrilliantWMS.RoleMasterService.iRoleMasterClient();
                // GridRoleMaster.DataSource = roleMasterService.BindRoleMasterSummary(profile.DBConnection._constr); Comment by vishal
                GridRoleMaster.DataSource = roleMasterService.BindGWCRoleMasterSummary(profile.DBConnection._constr);

                GridRoleMaster.DataBind();
                roleMasterService.Close();
                // TabContainerRoleMaster.ActiveTabIndex = 0;
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Role Master", "BindRoleMasterGridView");
            }
            finally
            {
            }
        }
        public static void UpdateRole(object role, object rowIndex)
        {
            BrilliantWMS.RoleMasterService.iRoleMasterClient roleMasterService = new BrilliantWMS.RoleMasterService.iRoleMasterClient();
            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)role;
                //connectiondetails AppConnectionDetails = new connectiondetails();
                //SP_GetDataToBindRoleMaster_Result updateRole = new SP_GetDataToBindRoleMaster_Result(); comment by vishal
                SP_GWCGetDataToBindRoleMaster_Result updateRole = new SP_GWCGetDataToBindRoleMaster_Result();
                updateRole.mSequence = Convert.ToInt64(dictionary["mSequence"]);
                updateRole.pSequence = Convert.ToInt64(dictionary["pSequence"]);
                updateRole.oSequence = Convert.ToInt64(dictionary["oSequence"]);

                updateRole.Add = Convert.ToBoolean(dictionary["Add"]);

                //if (updateRole.Add == true) { updateRole.Edit = true; updateRole.View = true; }
                //else { updateRole.Edit = false; }

                //Add By Suresh
                if (updateRole.Add == true)
                {
                    updateRole.Edit = true;
                }
                else
                {
                    updateRole.Edit = false;
                }

                if (updateRole.View == true)
                {
                    updateRole.View = true;
                }
                else
                {
                    updateRole.View = false;
                }

                //updateRole.View = true;
                updateRole.Delete   = false;
                updateRole.Approval = Convert.ToBoolean(dictionary["Approval"]);

                if (updateRole.Approval == true)
                {
                    updateRole.View = true;
                }
                //updateRole.AssignTask = Convert.ToBoolean(dictionary["AssignTask"]);comment by vishal

                //if (updateRole.AssignTask == true) comment bi vishal
                //{
                //    updateRole.View = true;
                //}
                //if (updateRole.Add == true && updateRole.Approval == false && updateRole.AssignTask == false && Convert.ToBoolean(dictionary["View"]) == true) comment by vishal
                //{
                //    updateRole.View = true;
                //}

                //HttpContext.Current.Session["sessionRoleList"] = roleMasterService.UpdateRoleIntoSessionList(getSessionList().ToArray(), updateRole, Convert.ToInt32(rowIndex), profile.DBConnection._constr).ToList();Comment by vishal
                HttpContext.Current.Session["sessionRoleList"] = roleMasterService.GWCUpdateRoleIntoSessionList(getSessionList1().ToArray(), updateRole, Convert.ToInt32(rowIndex), profile.DBConnection._constr).ToList();
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, "Role Master", "UpdateRole");
            }
            finally
            {
                roleMasterService.Close();
            }
        }