Exemple #1
0
        public ActionResult Create(FormCollection collection)
        {
            CCIRepository repository = CCIRepository.CreateRepository();
            UserModel     _usermodel = new UserModel();

            if (ModelState.IsValid)
            {
                //_usermodel.EmployeeId = Convert.ToInt32(collection["EmployeeId"]);
                _usermodel.EmployeeName     = collection["EmployeeName"].ToString();
                _usermodel.AccountName      = collection["AccountName"].ToString();
                _usermodel.EmailAddress     = collection["EmailAddress"].ToString();
                _usermodel.CostCenterId     = Convert.ToInt32(collection["CostCenterId"]);
                _usermodel.MobileNumber     = Convert.ToInt64(collection["MobileNumber"]);
                _usermodel.MobileAcNumber   = Convert.ToInt64(collection["MobileAcNumber"]);
                _usermodel.DataCardNumber   = Convert.ToInt64(collection["DataCardNumber"]);
                _usermodel.DatacardAcNumber = Convert.ToInt64(collection["DatacardAcNumber"]);
                _usermodel.OfficeLocation   = collection["OfficeLocation"].ToString();
                repository.CreateANewData(_usermodel);
            }
            return(View());
        }