public List <SP_GWCGetDataToBindRoleMaster_Result> GWCUpdateRoleIntoSessionList(List <SP_GWCGetDataToBindRoleMaster_Result> sessionList, SP_GWCGetDataToBindRoleMaster_Result updateRole, int rowindex, string[] conn) { BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn)); SP_GWCGetDataToBindRoleMaster_Result findRow = new SP_GWCGetDataToBindRoleMaster_Result(); findRow = sessionList.Where(s => s.mSequence == updateRole.mSequence && s.pSequence == updateRole.pSequence && s.oSequence == updateRole.oSequence).FirstOrDefault(); if (findRow != null) { sessionList = sessionList.Where(s => s != findRow).ToList(); findRow.Add = updateRole.Add; findRow.Edit = updateRole.Edit; findRow.View = updateRole.View; findRow.Delete = updateRole.Delete; findRow.Approval = updateRole.Approval; findRow.AssignTask = updateRole.AssignTask; } sessionList.Add(findRow); return(sessionList); }
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(); } }