Exemplo n.º 1
0
        public ActionResult BookMaster(Jct_Asset_Dep_Book model)
        {
            Jct_Asset_Dep_Book obj = new Jct_Asset_Dep_Book();

            obj.BookCode         = model.Book_Name.Substring(0, 3);
            obj.Book_Name        = model.Book_Name;
            obj.Created_By       = "A-00251";
            obj.Created_On       = System.DateTime.Now;
            obj.Effe_From        = System.DateTime.Today;
            obj.Effe_To          = System.DateTime.MaxValue;
            obj.Created_Hostname = System.Environment.MachineName;
            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_Insert";
            SqlCommand    cmd = new SqlCommand(sql, con);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@BookCode", obj.BookCode);
            cmd.Parameters.AddWithValue("@Book_Name", obj.Book_Name);
            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("@6", obj.Created_On);
            cmd.Parameters.AddWithValue("@Created_Hostname", obj.Created_Hostname);
            cmd.Parameters.AddWithValue("@Ip_Address", obj.Ip_Address);
            cmd.ExecuteNonQuery();
            con.Close();
            return(RedirectToAction("BookMaster", "BookMaster", null));
        }
Exemplo n.º 2
0
 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();
 }