Exemple #1
0
 public static Boolean UpdateUserInClient(UserInClientClass map)
 {
     Boolean flag = false;
     try
     {
     IMapping objtext = new BALClient();
     flag = objtext.UpdateMapping(map);
     }
     catch (Exception ex)
     {
     throw;
     }
     return flag;
 }
 public ActionResult UpdateMapping(UserInClientClass model)
 {
     if (Session["Login"] != null)
     {
         UserInClientClass mapping = new UserInClientClass();
         LoginSession loginsession = (LoginSession)Session["Login"];
         ViewBag.CompanyLogo = loginsession.CompanyLogo;
         mapping.modifyBy = Convert.ToInt64(loginsession.UserID);
         if ((model.MapID != null) && (model.ReleaseDate != null))
         {
             try
             {
                 mapping.MapID = model.MapID;
                 mapping.ReleaseDate = model.ReleaseDate;
                 if (BAL.ClientModel.UpdateUserInClient(mapping))
                 {
                     return RedirectToAction("MappingList", "Client");
                 }
                 else
                 {
                     return Content("Unable to save , try again");
                 }
             }
             catch (Exception ex)
             { return Content("ErrorMessage" + ":" + ex.StackTrace.ToString()); }
         }
         else
         { return RedirectToAction("MappingList", "Client"); }
     }
     else
     {
         RedirectToAction("Index", "Home");
     }
     return View();
 }
        public String SaveMapping(String ClientID, String Userid, String AssignDate)
        {
            if (Session["Login"] != null)
            {
                UserInClientClass mapping = new UserInClientClass();
                LoginSession loginsession = (LoginSession)Session["Login"];

                ViewBag.CompanyLogo = loginsession.CompanyLogo;
                mapping.CreateBy = Convert.ToInt64(loginsession.UserID);
                if ((ClientID != null) && (Userid != null))
                {
                    mapping.ClientID = ClientID;
                    mapping.UserID = Userid;
                    if (AssignDate != null)
                    {
                        mapping.AssignDate = AssignDate;
                    }
                    if (BAL.ClientModel.CreateUserInClient(mapping))
                    {
                        return "true";
                    }
                    else
                    {
                        return "false";
                    }
                }
                else
                { return "false"; }
            }
            else
            {
                RedirectToAction("Index", "Home");
                return "false";
            }
        }
        public String UpdateMapping(String MappID)
        {
            if (Session["Login"] != null)
            {
                UserInClientClass mapping = new UserInClientClass();
                LoginSession loginsession = (LoginSession)Session["Login"];
                ViewBag.CompanyLogo = loginsession.CompanyLogo;
                mapping.modifyBy = Convert.ToInt64(loginsession.UserID);
                if (MappID != null)
                {
                    mapping.MapID = MappID;

                    if (BAL.ClientModel.UpdateUserInClient(mapping))
                    {
                        return "true";
                    }
                    else
                    {
                        return "false";
                    }
                }
                else
                { return "false"; }
            }
            else
            {
                RedirectToAction("Index", "Home");
                return "false";
            }
        }
 public ActionResult Released(String Map_ID)
 {
     if (Session["Login"] != null)
     {
         UserInClientClass mapping = new UserInClientClass();
         LoginSession loginsession = (LoginSession)Session["Login"];
         ViewBag.CompanyLogo = loginsession.CompanyLogo;
         if (Map_ID != null)
         {
             String DecMapID = BAL.Security.URLDecrypt(Map_ID);
             if ((DecMapID != "0") && (DecMapID != null))
             {
                 DAL.UserInClientList _mapping = null;
                 try
                 {
                     _mapping = BAL.ClientModel.EditUserInclient(DecMapID);
                     ViewBag.Mapp = _mapping.MapID;
                     return View(_mapping);
                 }
                 catch (Exception ex)
                 {
                     return Content(ex.Message);
                 }
             }
             else
             {
                 return RedirectToAction("MappingList", "Client");
             }
         }
         else { return RedirectToAction("MappingList", "Client"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }