public ActionResult GroupMaster(Jct_Asset_Dep_Group model) { Jct_Asset_Dep_Group obj = new Jct_Asset_Dep_Group(); obj.GroupCode = model.Group_Name.Substring(0, 3); obj.Group_Name = model.Group_Name; obj.Created_By = HttpContext.User.Identity.Name; obj.Created_Hostname = System.Environment.MachineName; obj.Created_On = System.DateTime.Now; obj.Effe_From = System.DateTime.Today; obj.Effe_To = System.DateTime.MaxValue; obj.Status = "A"; obj.Ip_Address = ("::1" == System.Web.HttpContext.Current.Request.UserHostAddress) ? "localhost" : System.Web.HttpContext.Current.Request.UserHostAddress; SqlConnection con = DBConnection.getConnection(); string sql = "Jct_Asset_Dep_Book_Group_Insert"; SqlCommand cmd = new SqlCommand(sql, con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@GroupCode", obj.GroupCode); cmd.Parameters.AddWithValue("@Group_Name", obj.Group_Name); cmd.Parameters.AddWithValue("@Created_By", obj.Created_By); cmd.Parameters.AddWithValue("@Created_Hostname", obj.Created_Hostname); //cmd.Parameters.AddWithValue("@Effe_From", obj.Created_On); cmd.Parameters.AddWithValue("@Effe_From", obj.Effe_From); cmd.Parameters.AddWithValue("@Effe_To", obj.Effe_To); cmd.Parameters.AddWithValue("@Status", obj.Status); cmd.Parameters.AddWithValue("@Ip_Address", obj.Ip_Address); cmd.ExecuteNonQuery(); con.Close(); return(RedirectToAction("GroupMaster", "GroupMaster", null)); }
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(); }