Example #1
0
 public ActionResult AddClient(string ID)
 {
     try
     {
         Client objModelClient = new Client();
         if(ID!=null)
         {
             cClient objClient = cClient.Get_ID(Convert.ToInt32(ID));
             objModelClient.ClientIDHdn = objClient.iID.ToString();
             objModelClient.ClientName = objClient.sName;
             objModelClient.EmailIDUpdate = objClient.sEmailID;
             objModelClient.ContactUpdate = objClient.sContactNo;
             objModelClient.Address = objClient.sAddress;
             objModelClient.Description = objClient.sDescription;
         }
         return View(objModelClient);
     }
     catch (Exception ex)
     {
         
         throw ex;
     }
 }
Example #2
0
        public JsonResult AddClient(Client objAddClient, string ClientIDHdn)
        {
            try
            {
                if (ClientIDHdn != null && ClientIDHdn != "")
                {
                    int id = Convert.ToInt32(ClientIDHdn);
                    cClient objClient = cClient.Get_ID(id);
                    objClient.sName = objAddClient.ClientName;
                    objClient.sEmailID   = objAddClient.EmailIDUpdate;
                    objClient.sContactNo = objAddClient.ContactUpdate;
                    objClient.sAddress = objAddClient.Address;
                    objClient.sDescription = objAddClient.Description;
                    objClient.Save();
                    return Json("2");
                }
                else {
                    cClient objClient = cClient.Create();
                    objClient.sName = objAddClient.ClientName;
                    objClient.sEmailID = objAddClient.EmailID;
                    objClient.sContactNo = objAddClient.Contact;
                    objClient.sAddress = objAddClient.Address;
                    objClient.sDescription = objAddClient.Description;
                    objClient.Save();
                    return Json("3");
                }
              
            
            }
            catch (Exception ex)
            {

                throw ex;
            }

            
        }