コード例 #1
0
        public ActionResult Address(int Id)
        {
            try
            {
                ViewBag.Count = 0;
                SWI.AirView.Common.SelectedList sl = new SWI.AirView.Common.SelectedList();
                ViewBag.SelectedCountry = sl.Definations("Countries");
                ViewBag.SelectedState   = sl.Definations("States");
                ViewBag.Cities          = sl.Definations("Cities");
                ViewBag.SelectedPClient = sl.Clients("All");

                AD_ClientAddressBL adress  = new AD_ClientAddressBL();
                AD_ClientAddress   Address = adress.Single("ById", Id.ToString());
                if (Id != 0)
                {
                    List <AD_ClientAddress> Addresses = adress.ToList("ById", Id.ToString());
                    if (Addresses.Count > 0)
                    {
                        Address.Addresses = Addresses;
                        ViewBag.Count     = Addresses.Count;
                    }
                }
                return(PartialView("~/Views/Client/_ClientAddress.cshtml", Address));
            }
            catch (Exception ex)
            {
                return(PartialView("~/Views/Client/_ClientAddress.cshtml", null));
            }
        }
コード例 #2
0
        public ActionResult Edit(decimal Id = 0)
        {
            ViewBag.tit = "Edit";
            ViewBag.Id  = Id;
            SWI.AirView.Common.SelectedList sl = new SWI.AirView.Common.SelectedList();
            var Clienttypes = sl.Definations("byDefinationType", "Profile Type");

            ViewBag.SelectedClientTypes = Clienttypes;
            ViewBag.SelectedPClient     = sl.Clients("AllVendors");
            ClientsBL  ud      = new ClientsBL();
            AD_Clients Company = ud.Single1("ById", Id.ToString());

            if (Company == null)
            {
                TempData["msg_error"] = "Record Not Exist or You Are Not Authorize to access !";
                return(RedirectToAction("All", "Client"));
            }
            foreach (var item in Clienttypes)
            {
                if (item.Text != "Company" && (item.Value == Company.ClientTypeId.ToString()))
                {
                    return(RedirectToAction("Edit", "Client", new { Id = Id }));
                }
            }
            return(View("Edit", Company));
        }
コード例 #3
0
ファイル: ClientController.cs プロジェクト: swigithub/MVC
 public ActionResult Contact(int Id)
 {
     try
     {
         ViewBag.Count = 0;
         SWI.AirView.Common.SelectedList sl = new SWI.AirView.Common.SelectedList();
         ViewBag.SelectedPClient = sl.Clients("All");
         ViewBag.Users           = sl.Users("UserAll");
         ViewBag.Regions         = sl.RegionWithParent("RegionParent");
         ViewBag.Cities          = sl.Definations("Cities");
         ViewBag.Reports         = sl.ClientContacts("AllActive");
         AD_ClientContactsBL con     = new AD_ClientContactsBL();
         AD_ClientContacts   Contact = con.Single("ById", Id.ToString());
         if (Id != 0)
         {
             List <AD_ClientContacts> Contacts = con.ToList("ById", Id.ToString());
             if (Contacts.Count > 0)
             {
                 Contact.Client = Contacts;
                 ViewBag.Count  = Contacts.Count;
             }
         }
         return(PartialView("~/Views/Client/_ClientContact.cshtml", Contact));
     }
     catch (Exception ex)
     {
         return(PartialView("~/Views/Client/_ClientContact.cshtml", null));
     }
 }
コード例 #4
0
 // GET: Client
 public ActionResult NewSingle(string title)
 {
     ViewBag.tit = title;
     SWI.AirView.Common.SelectedList sl = new SWI.AirView.Common.SelectedList();
     ViewBag.SelectedClientTypes = sl.Definations("byDefinationType", "Profile Type");
     ViewBag.SelectedPClient     = sl.Clients("AllVendors");
     return(View());
 }
コード例 #5
0
        public ActionResult New()
        {
            ClientsBL ub   = new ClientsBL();
            var       List = ub.ToList("Company");

            SWI.AirView.Common.SelectedList sl = new SWI.AirView.Common.SelectedList();
            ViewBag.SelectedClientTypes = sl.Definations("byDefinationType", "Profile Type");
            ViewBag.SelectedPClient     = sl.Clients("AllVendors");
            if (List.Count > 0)
            {
                return(RedirectToAction("Edit", new { @Id = List[0].ClientId }));
            }
            else
            {
                return(View());
            }
        }