Esempio n. 1
0
        protected void GridLeaveEmp_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //วันเริ่มต้น
            Label lbLeaveStart = (Label)(e.Row.FindControl("lbLeaveStart"));

            if (lbLeaveStart != null)
            {
                lbLeaveStart.Text = dBScript.convertDatelongThai((string)DataBinder.Eval(e.Row.DataItem, "emp_leave_date_start"));
            }

            //วันเริ่มสิ้นสุด
            Label lbLeaveEnd = (Label)(e.Row.FindControl("lbLeaveEnd"));

            if (lbLeaveEnd != null)
            {
                lbLeaveEnd.Text = dBScript.convertDatelongThai((string)DataBinder.Eval(e.Row.DataItem, "emp_leave_date_end"));
            }

            //ใบรับรองแพทย์
            Label lbLeaveMedicalCertificate = (Label)(e.Row.FindControl("lbLeaveMedicalCertificate"));

            if (lbLeaveMedicalCertificate != null)
            {
                if ((bool)DataBinder.Eval(e.Row.DataItem, "emp_medical_certificate"))
                {
                    lbLeaveMedicalCertificate.Text = "<i class='fa fa-check-circle-o text-success'></i>";
                }
                else
                {
                    lbLeaveMedicalCertificate.Text = "<i class='fa fa-times-circle-o text-danger'></i>";
                }
            }

            //ตัดค่าจ้าง
            Label lbLeaveDeductionWages = (Label)(e.Row.FindControl("lbLeaveDeductionWages"));

            if (lbLeaveDeductionWages != null)
            {
                if ((int)DataBinder.Eval(e.Row.DataItem, "emp_leave_deduction_wages") > 0)
                {
                    int sum = (int)DataBinder.Eval(e.Row.DataItem, "emp_leave_sick") + (int)DataBinder.Eval(e.Row.DataItem, "emp_leave_relax") + (int)DataBinder.Eval(e.Row.DataItem, "emp_leave_maternity");
                    if ((int)DataBinder.Eval(e.Row.DataItem, "emp_leave_deduction_wages") == sum)
                    {
                        lbLeaveDeductionWages.CssClass = "text-danger";
                        lbLeaveDeductionWages.Text     = "ตัดค่าจ้างเต็ม";
                    }
                    else
                    {
                        lbLeaveDeductionWages.CssClass = "text-danger";
                        lbLeaveDeductionWages.Text     = "ตัดค่าจ้าง " + (int)DataBinder.Eval(e.Row.DataItem, "emp_leave_deduction_wages") + " วัน";
                    }
                }
                else
                {
                    lbLeaveDeductionWages.CssClass = "text-success";
                    lbLeaveDeductionWages.Text     = "ไม่ตัดค่าจ้าง";
                }
            }
        }
        protected void GridViewGuest_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            LinkButton lbGuestTitle = (LinkButton)(e.Row.FindControl("lbGuestTitle"));

            if (lbGuestTitle != null)
            {
                lbGuestTitle.CommandName = DataBinder.Eval(e.Row.DataItem, "guest_id").ToString();
            }

            LinkButton lbGueatRefer = (LinkButton)(e.Row.FindControl("lbGueatRefer"));

            if (lbGueatRefer != null)
            {
                lbGueatRefer.Text        = "ที่ " + (string)DataBinder.Eval(e.Row.DataItem, "guest_refer") + " เรื่อง " + (string)DataBinder.Eval(e.Row.DataItem, "guest_refer_title");
                lbGueatRefer.CommandName = (string)DataBinder.Eval(e.Row.DataItem, "guest_id").ToString();
            }

            LinkButton lbGuestDate = (LinkButton)(e.Row.FindControl("lbGuestDate"));

            if (lbGuestDate != null)
            {
                lbGuestDate.Text        = dBScript.convertDatelongThai((string)DataBinder.Eval(e.Row.DataItem, "guest_refer_date"));
                lbGuestDate.CommandName = (string)DataBinder.Eval(e.Row.DataItem, "guest_id").ToString();
            }

            Label lbGuestAmount = (Label)(e.Row.FindControl("lbGuestAmount"));

            if (lbGuestAmount != null)
            {
                lbGuestAmount.Text = dBScript.selectCount("tbl_guest_list", "guest_id = '" + DataBinder.Eval(e.Row.DataItem, "guest_id").ToString() + "'", "guest_id").ToString();
            }
        }
Esempio n. 3
0
        protected void TmpCopintGridView_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            Label lbempName = (Label)(e.Row.FindControl("lbempName"));

            if (lbempName != null)
            {
                lbempName.Text = (string)DataBinder.Eval(e.Row.DataItem, "profix_name") + (string)DataBinder.Eval(e.Row.DataItem, "emp_name") + "  " + (string)DataBinder.Eval(e.Row.DataItem, "emp_lname");
            }

            Label lbempChengDate = (Label)(e.Row.FindControl("lbempChengDate"));

            if (lbempChengDate != null)
            {
                lbempChengDate.Text = dBScript.convertDatelongThai((string)DataBinder.Eval(e.Row.DataItem, "tmp_cpoint_date"));
            }

            // เหลือเวลา
            Label lbempAgeWork = (Label)(e.Row.FindControl("lbCountdown"));

            if (lbempAgeWork != null)
            {
                string[]       data      = DataBinder.Eval(e.Row.DataItem, "tmp_cpoint_date").ToString().Split('-');
                DateTime       dateStart = DateTime.ParseExact(data[0] + "-" + data[1] + "-" + (int.Parse(data[2]) - 543), "dd-MM-yyyy", CultureInfo.InvariantCulture);
                DateDifference dDiff     = new DateDifference(dateStart);
                lbempAgeWork.Text = dDiff.ToString();
            }

            LinkButton btnConfirm = (LinkButton)(e.Row.FindControl("btnConfirm"));
            Label      txtConfirm = (Label)(e.Row.FindControl("txtConfirm"));

            if (btnConfirm != null)
            {
                btnConfirm.CommandName = DataBinder.Eval(e.Row.DataItem, "tmp_cpoint_id").ToString();
                if (DataBinder.Eval(e.Row.DataItem, "tmp_cpoint_status_approve").ToString() == "0")
                {
                    btnConfirm.Visible = true;
                    txtConfirm.Visible = false;
                }
                else
                {
                    btnConfirm.Visible = false;
                    txtConfirm.Visible = true;
                }
            }

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                try
                {
                    ((LinkButton)e.Row.Cells[6].Controls[0]).OnClientClick = "return confirmDelete(this);";
                }
                catch { }
            }
        }
Esempio n. 4
0
        private void ShowRport(bool copy)
        {
            //noteOffer reportNote = new noteOffer();
            ReportDocument reportNote = new ReportDocument();

            reportNote.Load(Server.MapPath("/Guest/noteOffer.rpt"));
            Session["Report"] = "";
            //reportNote.DataSourceConnections.Clear();
            //reportNote.Database.Tables.Reset();
            //CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            //rpt.Load(Server.MapPath("FinalReport.rpt"));
            //reportNote.SetDatabaseLogon("adminhrs", "admin25", "MySql DSN HR", "hrsystem");
            string pos_list = "ตำแหน่งพนักงานจัดเก็บและตำแหน่งพนักงานจัดการจราจร";

            reportNote.SetParameterValue("guest_id", txtGuest_id.Value.ToString());
            reportNote.SetParameterValue("txt_footer1", "เบื้องต้นฝ่ายบริหารการจัดเก็บเงินค่าธรรมเนียม ดำเนินการแนะนำกฎระเบียบที่เกี่ยวข้องกับงานราชการและการปฏิบัติงานใน" + pos_list + " ดังกล่าวข้างต้นและส่งตัวพนักงานไปปฏิบัติหน้าที่ตั้งแต่วันที่ " + dBScript.convertDatelongThai(txtOfferDate.Text.Trim()) + " เป็นต้นไป");
            reportNote.SetParameterValue("txt_footer2", "อนึ่ง ฝ่ายบริหารการจัดเก็บเงินค่าธรรมเนียม ได้แจ้งให้พนักงานทุกคนรับทราบ ในกรณีที่พนักงานฯ ปฏิบัติงานไม่ถึง 10 ผลัด จะไม่ขอรับเงินเดือน เรียบร้อยแล้ว");
            reportNote.SetParameterValue("txt_footer3", "จึงเรียนมาเพื่อโปรดทราบและดำเนินการต่อไป");
            reportNote.SetParameterValue("copy", copy);
            reportNote.SetParameterValue("user", Session["UserName"].ToString().Split(' ')[0]);

            Session["Report"]      = reportNote;
            Session["ReportTitle"] = "บันทึกข้อความ";
            Response.Write("<script>");
            Response.Write("window.open('/Report/reportView','_blank')");
            Response.Write("</script>");
            //resultListEmp.LogOnInfo = crTableLogonInfos;
        }