예제 #1
0
        public ActionResult _upd_Factory()
        {
            string fact_id = Request.QueryString["fact_code"];

            try
            {
                var tf = db.TM_Factory.Where(w => w.fact_id.Equals(fact_id)).ToList();
                tf.ForEach(a =>
                {
                    a.fact_name   = Request.QueryString["fact_name"];
                    a.fact_use    = Request.QueryString["fact_used"];
                    a.power       = Request.QueryString["fact_powe"];
                    a.mand        = Request.QueryString["fact_mand"];
                    a.money       = Request.QueryString["fact_mony"];
                    a.addess      = Request.QueryString["fact_adds"];
                    a.m           = Request.QueryString["fact_m"];
                    a.t           = Request.QueryString["fact_t"];
                    a.s           = Request.QueryString["fact_s"];
                    a.b           = Request.QueryString["fact_b"];
                    a.provinc     = Request.QueryString["fact_povc"];
                    a.city        = Request.QueryString["fact_city"];
                    a.phone       = Request.QueryString["fact_phon"];
                    a.create_date = DateTime.Now;
                });
                db.SaveChanges();
                return(Json(new { status_id = "1", status_massage = "success!...", updated = fact_id }, JsonRequestBehavior.AllowGet));
            }catch (Exception e)
            {
                return(Json(new { status_id = "0", status_massage = "Update Filed! : Error : " + e.Message }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #2
0
        public ActionResult Add_customer()
        {
            TD_Tempolary_Factory tmf = new TD_Tempolary_Factory();
            int max_code             = dbt.TD_Tempolary_Factory.Max(t => t.temp_id) + 1;

            tmf.temp_code    = "N" + max_code.ToString().PadLeft(13, '0');
            tmf.temp_name    = Request.QueryString["cust_name"];
            tmf.created_date = DateTime.Now;
            dbt.TD_Tempolary_Factory.Add(tmf);

            dbt.SaveChanges();

            return(RedirectToAction("Contact", "Home", new { flg = "1", msg = "Add factory sucess!" }));
        }