public ActionResult CompanyMaster(Jct_Asset_Dep_Company model) { Jct_Asset_Dep_Company obj = new Jct_Asset_Dep_Company(); obj.CompanyCode = model.CompanyName.Substring(0, 3); obj.CompanyName = model.CompanyName; obj.Created_By = "A-00251"; obj.Ip_Address = ("::1" == System.Web.HttpContext.Current.Request.UserHostAddress) ? "localhost" : System.Web.HttpContext.Current.Request.UserHostAddress; obj.Created_On = System.DateTime.Now; obj.Created_Hostname = Environment.MachineName; obj.Effe_From = System.DateTime.Today; obj.Effe_To = System.DateTime.MaxValue; SqlConnection con = DBConnection.getConnection(); string sql = "Jct_Asset_Dep_Company_Insert"; SqlCommand cmd = new SqlCommand(sql, con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CompanyCode", obj.CompanyCode); cmd.Parameters.AddWithValue("@CompanyName", obj.CompanyName); cmd.Parameters.AddWithValue("@Effe_From", obj.Effe_From); cmd.Parameters.AddWithValue("@Effe_To", obj.Effe_To); cmd.Parameters.AddWithValue("@Created_By", obj.Created_By); cmd.Parameters.AddWithValue("@Created_Hostname", obj.Created_Hostname); cmd.Parameters.AddWithValue("@Ip_Address", obj.Ip_Address); cmd.ExecuteNonQuery(); con.Close(); return(View("~/Views/MasterViews/CompanyMaster/CompanyMaster.cshtml")); }
public ParentViewModel() { Jct_Asset_Dep_Unit = new Jct_Asset_Dep_Unit(); Jct_Asset_Dep_Company = new Jct_Asset_Dep_Company(); Jct_Asset_Dep_SubUnit = new Jct_Asset_Dep_SubUnit(); Jct_Asset_Dep_Book = new Jct_Asset_Dep_Book(); Jct_Asset_Dep_Group = new Jct_Asset_Dep_Group(); Jct_Asset_Dep_SubGroup = new Jct_Asset_Dep_SubGroup(); Jct_Asset_Dep_CompanyActRate = new Jct_Asset_Dep_CompanyActRate(); Jct_Asset_Dep_Bill_Info = new Jct_Asset_Dep_Bill_Info(); Jct_Asset_Dep_Asset = new Jct_Asset_Dep_Asset(); Jct_Asset_Dep_Book_AccountingYear = new Jct_Asset_Dep_Book_AccountingYear(); Jct_Asset_Dep_Section = new Jct_Asset_Dep_Section(); FinancialYearMasterModel = new FinancialYearMasterModel(); Jct_Asset_Dep_Method = new Jct_Asset_Dep_Method(); Jct_Asset_Dep_Insurance = new Jct_Asset_Dep_Insurance(); Jct_Asset_Dep_Sub_Asset = new Jct_Asset_Dep_Sub_Asset(); Jct_Asset_Dep_Shift = new Jct_Asset_Dep_Shift(); SLMProspectiveCalculatorModel = new SLMProspectiveCalculatorModel(); DropDownViewModel = new DropDownViewModel(); ReportViewModel = new ReportViewModel(); }