Beispiel #1
0
 private void subGetData()
 {
     if (Session["Punch_Confirm_Remedy_Bean"] == null)
     {
         //Response.Redirect("PunchUpdateInquire.aspx");
     }
     else
     {
         Dictionary <string, string> dic = (Dictionary <string, string>)Session["Punch_Confirm_Remedy_Bean"];
         ViewState["Punch_Confirm_Remedy_Bean"] = Session["Punch_Confirm_Remedy_Bean"];
         Quire_to_Modify = PunchUpdate.Punch_Confirm_Remedy_DicToBean(dic);
         DoClear();
         //Session["Quire_to_Modify"] = null;
     }
 }
Beispiel #2
0
    private bool SaveData()
    {
        Dictionary <string, string> dic = (Dictionary <string, string>)ViewState["Punch_Confirm_Remedy_Bean"];

        Quire_to_Modify = PunchUpdate.Punch_Confirm_Remedy_DicToBean(dic);
        int    Seq          = 0;
        bool   result       = false;
        long   seccessCount = 0;
        string msg          = ""; //因為Exception用ShowMsg會不能顯示,所以取得msg後不使用(這就是沒用的變數)
        int    PunchTimeHH  = 0;

        if (!int.TryParse(ucRemedyPunchTime.ucDefaultSelectedHH, out PunchTimeHH))
        {
            PunchTimeHH = 0;
        }

        Punch_Confirm_Remedy_Bean model = new Punch_Confirm_Remedy_Bean()
        {
            //跟Confirm一樣的內容,不修改
            FlowCaseID       = "",
            CompID           = Quire_to_Modify.CompID.Trim(),
            EmpID            = Quire_to_Modify.EmpID.Trim(),
            EmpName          = Quire_to_Modify.EmpName.Trim(),
            DutyDate         = Quire_to_Modify.DutyDate.Trim(),
            DutyTime         = Quire_to_Modify.DutyTime.Replace(":", "").Trim(),
            PunchDate        = Quire_to_Modify.PunchDate.Trim(),
            PunchTime        = Quire_to_Modify.PunchTime.Trim(),
            PunchConfirmSeq  = Quire_to_Modify.PunchConfirmSeq.Trim(),
            DeptID           = Quire_to_Modify.DeptID.Trim(),
            DeptName         = Quire_to_Modify.DeptName.Trim(),
            OrganID          = Quire_to_Modify.OrganID.Trim(),
            OrganName        = Quire_to_Modify.OrganName.Trim(),
            FlowOrganID      = Quire_to_Modify.FlowOrganID.Trim(),
            FlowOrganName    = Quire_to_Modify.FlowOrganName.Trim(),
            MAFT10_FLAG      = Quire_to_Modify.MAFT10_FLAG.Trim(),
            AbnormalFlag     = Quire_to_Modify.AbnormalFlag.Trim(),
            AbnormalReasonID = Quire_to_Modify.AbnormalReasonID.Trim(),
            AbnormalReasonCN = Quire_to_Modify.AbnormalReasonCN.Trim(),
            AbnormalDesc     = Quire_to_Modify.AbnormalDesc.Trim(),

            //Remedy修改項目
            PunchRemedySeq = (int.TryParse(Quire_to_Modify.PunchRemedySeq, out Seq) ? Seq + 1 : 1).ToString().Trim(),

            RemedyReasonID  = ddlRemedyReasonID.SelectedValue.Trim(),
            RemedyReasonCN  = ddlRemedyReasonID.SelectedValue.Trim() == "" ? "" : ddlRemedyReasonID.SelectedItem.Text.Trim(),
            RemedyPunchTime = ucRemedyPunchTime.ucSelectedTime.Trim(),

            Remedy_MAFT10_FLAG      = (Quire_to_Modify.Sex.Trim() == "2" && (PunchTimeHH >= 22)) ? "1" : "0",
            Remedy_AbnormalFlag     = rdoRemedy_AbnormalFlag1.Checked ? "1" : "2", //待John檢核公用
            Remedy_AbnormalReasonID = ddlRemedy_AbnormalReasonID.SelectedValue.Trim(),
            Remedy_AbnormalReasonCN = ddlRemedy_AbnormalReasonID.SelectedValue.Trim() == "" ? "" : ddlRemedy_AbnormalReasonID.SelectedItem.Text.Trim(),
            Remedy_AbnormalDesc     = txtRemedy_AbnormalDesc.Text.Trim(),

            LastChgComp = UserInfo.getUserInfo().CompID.Trim(),
            LastChgID   = UserInfo.getUserInfo().UserID.Trim(),
            LastChgDate = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"),

            //Remedy特有
            RemedyPunchFlag = Quire_to_Modify.ConfirmPunchFlag.Trim(), //補登檔RemedyPunchFlag=確認檔ConfirmPunchFlag=紀錄檔PunchFlag
            BatchFlag       = Quire_to_Modify.BatchFlag.Trim(),        //批次更新確認檔處理註記,0:未處理,1:已處理。(保留暫定)
            PORemedyStatus  = "2",
            RejectReason    = "",
            RejectReasonCN  = "",
            ValidDateTime   = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"),
            //ValidTime = "",
            ValidCompID = UserInfo.getUserInfo().CompID.Trim(),
            ValidID     = UserInfo.getUserInfo().UserID.Trim(),
            ValidName   = UserInfo.getUserInfo().UserName.Trim()
        };

        result = PunchUpdate.PunchUpdateModify_SaveData(model, out seccessCount, out msg);
        if (!result)
        {
            msg = "送簽失敗!!-" + msg;
            return(false);
        }
        if (seccessCount == 0)
        {
            msg = "送簽失敗!!";
            return(false);
        }
        msg = "送簽成功!!";
        return(true);
    }