// -------------------->> Tab-4 ( Create Access Rights )

        public ActionResult BindDropdown_FormLoadAccessRights(CommanFieldPara CFP)
        {
            try
            {
                DataSet ds = _objRoleRightsDb.BindDropdown_FormLoadAccessRights(CFP);

                List<CommanDropdown> Corporate = new List<CommanDropdown>();
                List<CommanDropdown> Status = new List<CommanDropdown>();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ViewBag.fname = ds.Tables[0];
                    foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
                    {
                        Corporate.Add(new CommanDropdown { Text = @dr["xname"].ToString(), Value = @dr["xcode"].ToString() });
                    }
                }

                if (ds.Tables[1].Rows.Count > 0)
                {
                    ViewBag.Status = ds.Tables[1];
                    foreach (System.Data.DataRow dr in ViewBag.Status.Rows)
                    {
                        Status.Add(new CommanDropdown { Text = @dr["xname"].ToString(), Value = @dr["xcode"].ToString() });
                    }
                }

                var Corporatedrp = Corporate; var Status_Drp = Status;
                return Json(new { Corp = Corporatedrp, Status = Status_Drp }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public ActionResult BindDropDownLoad(CommanFieldPara _CBP)
        {
            try
            {
                DataSet ds = _objDBViewSetup.BindDropDownFormLoad(_CBP);
                List<CommanDropdown> items = new List<CommanDropdown>();
                List<CommanDropdown> Master = new List<CommanDropdown>();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ViewBag.fname = ds.Tables[0];
                    foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
                    {
                        items.Add(new CommanDropdown { Text = dr["xname"].ToString(), Value = dr["xcode"].ToString() });
                    }
                }
                var result = items;

                if (ds.Tables[1].Rows.Count > 0)
                {
                    ViewBag.fname = ds.Tables[1];
                    foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
                    {
                        Master.Add(new CommanDropdown { Text = dr["xname"].ToString(), Value = dr["xcode"].ToString() });
                    }
                }
                var result1 = Master;
                return Json(new { GTCorporate = result, GTMaster = result1 }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception)
            {
                throw;
            }
        }
 public DataSet BindDropdown_FormLoadAccessRights(CommanFieldPara CFP)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("sp_Formload_RoleMaster", _cn);
         _cmd.CommandType = CommandType.StoredProcedure;
         _cmd.Parameters.AddWithValue("@Module", CFP.Module);
         _cmd.Parameters.AddWithValue("@screen", CFP.screen);
         _cmd.Parameters.AddWithValue("@FormCode", CFP.FormCode);
         _cmd.Parameters.AddWithValue("@TabCode", CFP.TabCode);
         _cmd.Parameters.AddWithValue("@Corporate", CFP.Corporate);
         _cmd.Parameters.AddWithValue("@unit", CFP.unit);
         _cmd.Parameters.AddWithValue("@Branch", CFP.Branch);
         _cmd.Parameters.AddWithValue("@userid", CFP.userid);
         _cmd.Parameters.AddWithValue("@Ip", CFP.Ip);
         _cmd.Parameters.AddWithValue("@Type", CFP.Type);
         _cmd.Parameters.AddWithValue("@Srno", CFP.Srno);
         _cmd.CommandType = CommandType.StoredProcedure;
         SqlDataAdapter _adp = new SqlDataAdapter(_cmd);
         DataSet _ds = new DataSet();
         _adp.Fill(_ds);
         _adp.Dispose();
         _cmd.Dispose();
         return _ds;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         _cn.Close();
         _cn.Dispose();
     }
 }
 public ActionResult BindDropDown(CommanFieldPara CFP)
 {
     try
     {
         DataSet ds = _objwl.BindDropDown(CFP);
         List<CommanDropdown> Industry = new List<CommanDropdown>();
         List<CommanDropdown> items = new List<CommanDropdown>();//company Type
         List<CommanDropdown> itemservice = new List<CommanDropdown>();
         List<CommanDropdown> BMode = new List<CommanDropdown>();
         List<CommanDropdown> CURRENCY = new List<CommanDropdown>();
         List<CommanDropdown> Language = new List<CommanDropdown>();
         List<CommanDropdown> Corporate = new List<CommanDropdown>();
         if (ds.Tables[0].Rows.Count > 0)
         {
             ViewBag.fname = ds.Tables[0];
             foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
             {
                 Industry.Add(new CommanDropdown { Text = dr["xname"].ToString(), Value = dr["xcode"].ToString() });
             }
         }
         var Industrys = Industry;
         if (ds.Tables[1].Rows.Count > 0)
         {
             ViewBag.fname = ds.Tables[1];
             foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
             {
                 items.Add(new CommanDropdown { Text = dr["xname"].ToString(), Value = dr["xcode"].ToString() });
             }
         }
         var result = items;
         if (ds.Tables[2].Rows.Count > 0)
         {
             ViewBag.fname = ds.Tables[2];
             foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
             {
                 itemservice.Add(new CommanDropdown { Text = dr["xname"].ToString(), Value = dr["xcode"].ToString() });
             }
         }
         var service = itemservice;
         if (ds.Tables[3].Rows.Count > 0)
         {
             ViewBag.fname = ds.Tables[3];
             foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
             {
                 BMode.Add(new CommanDropdown { Text = dr["xname"].ToString(), Value = dr["xcode"].ToString() });
             }
         }
         var BussineMode = BMode;
         if (ds.Tables[4].Rows.Count > 0)
         {
             ViewBag.fname = ds.Tables[4];
             foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
             {
                 CURRENCY.Add(new CommanDropdown { Text = dr["xname"].ToString(), Value = dr["xcode"].ToString() });
             }
         }
         var currency = CURRENCY;
         if (ds.Tables[5].Rows.Count > 0)
         {
             ViewBag.fname = ds.Tables[5];
             foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
             {
                 Language.Add(new CommanDropdown { Text = dr["xname"].ToString(), Value = dr["xcode"].ToString() });
             }
         }
         var language = Language;
         if (ds.Tables[6].Rows.Count > 0)
         {
             ViewBag.fname = ds.Tables[6];
             foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
             {
                 Corporate.Add(new CommanDropdown { Text = dr["xname"].ToString(), Value = dr["xcode"].ToString() });
             }
         }
         var corporate = Corporate;
         return Json(new { GTINDUTRYS = Industrys, GTIndutry = result, GTservice = service, GTBmode = BussineMode, GTcurrency = currency, GTlanguage = language, GTCorporate = corporate }, JsonRequestBehavior.AllowGet);
     }
     catch (Exception)
     {
         throw;
     }
 }
 public DataSet BindDropdownLocation(CommanFieldPara CFP)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("sp_Base_UserRoleMaster", _cn);
         _cmd.CommandType = CommandType.StoredProcedure;
         _cmd.Parameters.AddWithValue("@Module", CFP.Module);
         _cmd.Parameters.AddWithValue("@screen", CFP.screen);
         _cmd.Parameters.AddWithValue("@FormCode", CFP.FormCode);
         _cmd.Parameters.AddWithValue("@TabCode", CFP.TabCode);
         _cmd.Parameters.AddWithValue("@Corporate", CFP.Corporate);
         _cmd.Parameters.AddWithValue("@unit", CFP.unit);
         _cmd.Parameters.AddWithValue("@Branch", CFP.Branch);
         _cmd.Parameters.AddWithValue("@userid", CFP.userid);
         _cmd.Parameters.AddWithValue("@Ip", CFP.Ip);
         _cmd.Parameters.AddWithValue("@Type", CFP.Type);
         _cmd.Parameters.AddWithValue("@field1", "UNIT-2-0-1");
         _cmd.Parameters.AddWithValue("@field2", "");
         _cmd.Parameters.AddWithValue("@field3", "");
         _cmd.Parameters.AddWithValue("@field4", "");
         _cmd.Parameters.AddWithValue("@field5", "");
         _cmd.Parameters.AddWithValue("@Control", "DrpLocation");
         _cmd.Parameters.AddWithValue("@Srno", CFP.Srno);
         _cmd.CommandType = CommandType.StoredProcedure;
         SqlDataAdapter _adp = new SqlDataAdapter(_cmd);
         DataSet _ds = new DataSet();
         _adp.Fill(_ds);
         _adp.Dispose();
         _cmd.Dispose();
         return _ds;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         _cn.Close();
         _cn.Dispose();
     }
 }
        public ActionResult BindDropdown_Base(CommanFieldPara CFP)
        {
            try
            {
                DataSet ds = _objWhitelabelAccessRights.BindDropdown_Base(CFP);
                List<CommanDropdown> Corporate = new List<CommanDropdown>();
                //List<CommanDropdown> Item = new List<CommanDropdown>();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ViewBag.fname = ds.Tables[0];
                    foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
                    {
                        Corporate.Add(new CommanDropdown { Text = @dr["xname"].ToString(), Value = @dr["xcode"].ToString() });
                    }
                }
                var Corporatedrp = Corporate;
                return Json(new { Corp = Corporatedrp }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public ActionResult BindDropdownUserrole(CommanFieldPara CFP)
        {
            try
            {
                DataSet ds = _obj_db_UM.BindDropdownUserrole(CFP);
                List<CommanDropdown> Industry = new List<CommanDropdown>();
                List<CommanDropdown> Item = new List<CommanDropdown>();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ViewBag.fname = ds.Tables[0];
                    foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
                    {
                        Industry.Add(new CommanDropdown { Text = @dr["xname"].ToString(), Value = @dr["xcode"].ToString() });
                    }
                }
                var Unitdrp = Industry;

                if (ds.Tables[1].Rows.Count > 0)
                {
                    ViewBag.fname = ds.Tables[1];
                    foreach (System.Data.DataRow dr in ViewBag.fname.Rows)
                    {
                        Item.Add(new CommanDropdown { Text = @dr["xname"].ToString(), Value = @dr["xcode"].ToString() });
                    }
                }
                var Locationdrp = Item;

                return Json(new { UNITDRPJS = Unitdrp, USERDRPJS = Locationdrp }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception)
            {
                throw;
            }
        }