Beispiel #1
0
        public ActionResult Index(FormCollection form)
        {
            string sMacCode = iWork.Get_MacCodeByMacAddress();
            string sPerCode = comm.sGetString(form["per_code"]);
            string sMoCode  = iWork.Get_MoCodeByMacCode(sMacCode);

            if (iWork.Get_PerLoginStatus(sPerCode, sMacCode) == "O")
            {
                //沒有上工記錄,進行上工動作
                //寫入報工歷程檔 RowData
                MED01_0000 med01_0000 = new MED01_0000();
                comm.Set_ModelValue(med01_0000, form); //設定值
                med01_0000.mo_code      = "";
                med01_0000.wrk_code     = "";
                med01_0000.mac_code     = comm.sGetString(sMacCode);
                med01_0000.ins_date     = comm.Get_Date();
                med01_0000.ins_time     = comm.Get_Time();
                med01_0000.usr_code     = comm.sGetString(sPerCode);
                med01_0000.login_status = "I";
                med01_0000.InsertData(med01_0000);

                //寫入報工統計檔
                MED01_0100 med01_0100 = new MED01_0100();
                comm.Set_ModelValue(med01_0100, form);//設定值
                med01_0100.mo_code  = "";
                med01_0100.wrk_code = "";
                med01_0100.mac_code = comm.sGetString(sMacCode);
                med01_0100.usr_code = comm.sGetString(sPerCode);
                med01_0100.date_s   = comm.Get_Date();
                med01_0100.time_s   = comm.Get_Time();
                med01_0100.date_e   = "";
                med01_0100.time_e   = "";
                med01_0100.status   = "I";
                med01_0100.InsertData(med01_0100);
                med01_0000.UPD_MEM01_UsrCode(sMacCode, sPerCode, sMoCode);
            }
            else
            {
                //已有上工記錄,進行下工動作

                //寫入報工歷程檔 RowData
                MED01_0000 med01_0000 = new MED01_0000();
                comm.Set_ModelValue(med01_0000, form);
                med01_0000.mo_code      = "";
                med01_0000.wrk_code     = "";
                med01_0000.mac_code     = comm.sGetString(sMacCode);
                med01_0000.ins_date     = comm.Get_Date();
                med01_0000.ins_time     = comm.Get_Time();
                med01_0000.usr_code     = comm.sGetString(sPerCode);
                med01_0000.login_status = "O";
                med01_0000.InsertData(med01_0000);

                //回寫報工統計檔下工記錄
                string imed01_0100 = iWork.Get_med01_0100(sPerCode, sMacCode);
                iWork.Upd_PerLogOut(imed01_0100);
                med01_0000.UPD_MEM01_UsrCode(sMacCode, "", sMoCode);
            }
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Index(FormCollection form)
        {
            string sMacCode = "";

            if (Request.Cookies["MacCode"] != null)
            {
                sMacCode = Request.Cookies["MacCode"].Value;
            }

            //寫入報工歷程檔 RowData
            MED01_0000 med01_0000 = new MED01_0000();

            comm.Set_ModelValue(med01_0000, form);
            med01_0000.mo_code      = "";
            med01_0000.wrk_code     = "";
            med01_0000.mac_code     = comm.sGetString(sMacCode);
            med01_0000.ins_date     = comm.Get_Date();
            med01_0000.ins_time     = comm.Get_Time();
            med01_0000.usr_code     = comm.sGetString(form["per_code"]);
            med01_0000.login_status = "O";
            med01_0000.InsertData(med01_0000);

            return(RedirectToAction("Index"));
        }