示例#1
0
        public void Except_Start(FormCollection form)
        {
            object data        = new object();
            string sExceptCode = comm.sGetString(form["except_code"]);

            for (int i = 1; i < 10; i++)
            {
                if (form["user_field_0" + i] == "undefined")
                {
                    form["user_field_0" + i] = "";
                }
            }
            if (form["user_field_10"] == "undefined")
            {
                form["user_field_10"] = "";
            }
            MED05_0000 med05_0000 = new MED05_0000();

            comm.Set_ModelValue(med05_0000, form);
            med05_0000.mo_code     = pubMoCode();
            med05_0000.wrk_code    = pubWorkCode();
            med05_0000.mac_code    = pubMacCode();
            med05_0000.except_code = sExceptCode;
            med05_0000.date_s      = DateTime.Now.ToString("yyyy/MM/dd");
            med05_0000.time_s      = DateTime.Now.ToString("HH:mm:ss");
            med05_0000.ins_date    = DateTime.Now.ToString("yyyy/MM/dd");
            med05_0000.ins_time    = DateTime.Now.ToString("HH:mm:ss");
            med05_0000.usr_code    = pubPerCode();
            med05_0000.is_ng       = "N";
            med05_0000.is_end      = "N";
            DT.InsertData("MED05_0000", med05_0000);

            //data = new
            //{
            //    mo_code = pubMoCode(),
            //    wrk_code = pubWorkCode(),
            //    mac_code = pubMacCode(),
            //    except_code = sExceptCode,
            //    date_s = DateTime.Now.ToString("yyyy/MM/dd"),
            //    time_s = DateTime.Now.ToString("HH:mm:ss"),
            //    ins_date = DateTime.Now.ToString("yyyy/MM/dd"),
            //    ins_time = DateTime.Now.ToString("HH:mm:ss"),
            //    usr_code = pubPerCode(),
            //    is_ng = "N",
            //    is_end = "N",

            //    //mo_code = pubMoCode(),
            //    //wrk_code = pubWorkCode(),
            //    //mac_code = pubMacCode(),
            //    //except_code = sExceptCode,

            //    //time_s = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
            //    //time_e = "",
            //    //pro_code ="",
            //    //per_code= pubPerCode(),
            //    //usr_code = pubPerCode(),
            //    ////is_ng = "N",
            //    ////is_end = "N",
            //};
            //string dataJSON = JsonConvert.SerializeObject(data);
            //string json = MesApi.Ins_ExceptData(pubToken, dataJSON);
            //JObject obj_ins = JsonConvert.DeserializeObject<JObject>(json);
            //ViewBag.message = obj_ins["Message"].ToString();  ////錯誤訊息
        }
示例#2
0
        public void Stop_Start(FormCollection form)
        {
            object data      = new object();
            string sStopCode = comm.sGetString(form["stop_code"]);

            for (int i = 1; i < 10; i++)
            {
                if (form["user_field_0" + i] == "undefined")
                {
                    form["user_field_0" + i] = "";
                }
            }
            if (form["user_field_10"] == "undefined")
            {
                form["user_field_10"] = "";
            }
            MED04_0000 med04_0000 = new MED04_0000();

            comm.Set_ModelValue(med04_0000, form);
            //data = new
            //{
            //    mo_code = pubMoCode(),
            //    wrk_code = pubWorkCode(),
            //    mac_code = pubMacCode(),
            //    stop_code = sStopCode,
            //    date_s = DateTime.Now.ToString("yyyy/MM/dd"),
            //    time_s = DateTime.Now.ToString("HH:mm:ss"),
            //    ins_date = DateTime.Now.ToString("yyyy/MM/dd"),
            //    ins_time = DateTime.Now.ToString("HH:mm:ss"),
            //    usr_code = pubPerCode(),
            //    is_ng = "N",
            //    is_end = "N",
            //};
            med04_0000.mo_code   = pubMoCode();
            med04_0000.wrk_code  = pubWorkCode();
            med04_0000.mac_code  = pubMacCode();
            med04_0000.stop_code = sStopCode;
            med04_0000.date_s    = DateTime.Now.ToString("yyyy/MM/dd");
            med04_0000.time_s    = DateTime.Now.ToString("HH:mm:ss");
            med04_0000.ins_date  = DateTime.Now.ToString("yyyy/MM/dd");
            med04_0000.ins_time  = DateTime.Now.ToString("HH:mm:ss");
            med04_0000.usr_code  = pubPerCode();
            med04_0000.is_ng     = "N";
            med04_0000.is_end    = "N";
            DT.InsertData("MED04_0000", med04_0000);


            //med04_0000 = new MED04_0000
            //{
            //    mo_code = pubMacCode(),
            //    wrk_code = pubWorkCode(),
            //    mac_code = pubMacCode(),
            //    stop_code = sStopCode,
            //    date_s = DateTime.Now.ToString("yyyy/MM/dd"),
            //    time_s = DateTime.Now.ToString("HH:mm:ss"),
            //    ins_date = DateTime.Now.ToString("yyyy/MM/dd"),
            //    ins_time = DateTime.Now.ToString("HH:mm:ss"),
            //    usr_code = pubPerCode(),
            //    is_ng = "N",
            //    is_end = "N",
            //};
            ////med04_0000.InsertData(med04_0000);
            //DT.InsertData("MED04_0000", med04_0000);
        }