示例#1
0
        public ActionResult EditDetails(string id)
        {
            ViewBag.BranchDetails      = new BranchMasterEntity();
            ViewBag.CountryList        = CountryHelper.GetCountryData();
            ViewBag.StateByCountryList = StateByCountryHelper.GetStateByCountryData("0");
            List <BranchMasterEntity> _branchEntity = BranchHelper.GetBranchData(id);

            return(View("Index", _branchEntity.FirstOrDefault()));
        }
示例#2
0
        // GET: Company

        public ActionResult Index()
        {
            CompanyEntity _companyEntity = new CompanyEntity();

            ViewBag.companyDetails = _companyEntity;

            ViewBag.CountryList = CountryHelper.GetCountryData();

            ViewBag.StateByCountryList = StateByCountryHelper.GetStateByCountryData("0");

            return(View());
        }
示例#3
0
        // GET: Branch

        public ActionResult Index()
        {
            //BranchMasterEntity _BranchMasterEntity = new BranchMasterEntity();
            //return View(_BranchMasterEntity);

            BranchMasterEntity _BranchMasterEntity = new BranchMasterEntity();

            ViewBag.BranchDetails = _BranchMasterEntity;

            ViewBag.CountryList = CountryHelper.GetCountryData();

            ViewBag.StateByCountryList = StateByCountryHelper.GetStateByCountryData("0");

            return(View());
        }
示例#4
0
        public ActionResult Save(CompanyEntity companyEntity)
        {
            string FileName      = "";
            string FileExtension = "";
            string UploadPath    = "";

            if (companyEntity.ImageFile != null)
            {
                //Use Namespace called :  System.IO
                FileName = Path.GetFileNameWithoutExtension(companyEntity.ImageFile.FileName);

                //To Get File Extension
                FileExtension = Path.GetExtension(companyEntity.ImageFile.FileName);

                //Add Current Date To Attached File Name
                FileName = DateTime.Now.ToString("MM-dd-yyyy-HH-mm-ss") + "-" + FileName.Trim() + FileExtension;

                //Get Upload path from Web.Config file AppSettings.
                //string UploadPath = ConfigurationManager.AppSettings["UserImagePath"].ToString();
                UploadPath = Server.MapPath("~/CompanyLogo/");

                //Its Create complete path to store in server.
                companyEntity.LogoPath = UploadPath + FileName;

                //To copy and save file into server.
                companyEntity.ImageFile.SaveAs(companyEntity.LogoPath);
            }



            ViewBag.CountryList        = CountryHelper.GetCountryData();
            ViewBag.StateByCountryList = StateByCountryHelper.GetStateByCountryData("0");

            bool saveStatus;

            companyEntity.IsActive    = true;
            companyEntity.CreatedDate = DateTime.Now;
            companyEntity.CreatedBy   = 1;
            companyEntity.is_default  = 1;
            companyEntity.ImageFile   = null;                        //TO UPDATE MODEL SO THAT IT CAN BE SEND AS STRING TO API//
            companyEntity.LogoPath    = "~/CompanyLogo/" + FileName; //TO RESET THE FULL PATH ONLY TO FOLDER AND IMAGE NAME//

            companyEntity      = CompanyHelper.SaveCompanyData(companyEntity, out saveStatus);
            ViewBag.SaveStatus = saveStatus;
            return(View("Index", companyEntity));
        }
示例#5
0
        public ActionResult EditDetails(BranchMasterEntity branchEntity)
        {
            ViewBag.BranchDetails = new BranchMasterEntity();

            ViewBag.CountryList        = CountryHelper.GetCountryData();
            ViewBag.StateByCountryList = StateByCountryHelper.GetStateByCountryData("0");

            if (ModelState.IsValid)
            {
                //Use Namespace called :  System.IO
                //string FileName = Path.GetFileNameWithoutExtension(branchEntity.ImageFile.FileName);

                ////To Get File Extension
                //string FileExtension = Path.GetExtension(branchEntity.ImageFile.FileName);

                ////Add Current Date To Attached File Name
                //FileName = DateTime.Now.ToString("yyyyMMdd") + "-" + FileName.Trim() + FileExtension;

                ////Get Upload path from Web.Config file AppSettings.
                ////string UploadPath = ConfigurationManager.AppSettings["UserImagePath"].ToString();

                ////Its Create complete path to store in server.
                //branchEntity.ImagePath = Path.Combine(Server.MapPath("~/Content/BranchLogo"),
                //                           Path.GetFileName(FileName)); // UploadPath + FileName;

                ////To copy and save file into server.
                //branchEntity.ImageFile.SaveAs(branchEntity.ImagePath);


                bool saveStatus = false;
                saveStatus         = BranchHelper.EditBranchData(branchEntity, saveStatus);
                ViewBag.SaveStatus = saveStatus;
            }

            return(View(branchEntity));
        }
        public JsonResult StateByCountryList(string Id)
        {
            ViewBag.StateByCountryList = StateByCountryHelper.GetStateByCountryData(Id);

            return(Json(new SelectList(ViewBag.StateByCountryList.ToArray(), "ID", "StateName"), JsonRequestBehavior.AllowGet));
        }