Beispiel #1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //���ڲ���
            try
            {
                WA_Duty wd = new WA_Duty(Int32.Parse(Request.Cookies["UserID"].Value.Trim()));
                int DutyStat = 0;
                DutyStat = wd.HaveCompletedDuty(DateTime.Now);
                //��鵱���Ƿ��Ѿ�����ϰ࿼��
                if((DutyStat!=-1) && (DutyStat!=0))
                {
                        if(wd.CheckStatus(DutyAction.OffDuty)) //û������
                        {
                            wd.RecordOffDutyData(DutyStat,DateTime.Now,true,"");
                            //������ҳ���ʾ�ɹ�
                            Response.Write("<script language=javascript>window.open('../WorkAttendance/checksucessful.aspx?login=out','_blank','height=200,width=400,status=no,toolbar=no,menubar=no,location=no')</script>");
                        }
                        else//����
                        {
                            //��ת����д����ҳ��
                            Response.Write("<script language=javascript>location.href='../WorkAttendance/Default.aspx?notnormal=1&login=out';</script>");
                        }
                }
                Response.Write("<script>window.parent.parent.location.href='logout.aspx';</script>");
            }

            catch(Exception ex)
            {
                UDS.Components.Error.Log(ex.Message);
                Server.Transfer("../Error.aspx");
            }
        }
Beispiel #2
0
        protected string outdaycolor;        //无需出勤天数的背景色
        private void Page_Load(object sender, System.EventArgs e)
        {
            //
            indaycolor  = "#EBFFE5";
            outdaycolor = "#ffffef";
            if (!Page.IsPostBack)
            {
                try
                {
                    UDS.Components.WA_Duty wa = new UDS.Components.WA_Duty();
                    string begintime, endtime;
                    begintime = (Request.QueryString["begintime"] == null)?DateTime.Now.ToString():Request.QueryString["begintime"].ToString();
                    endtime   = (Request.QueryString["endtime"] == null)?DateTime.Now.ToString():Request.QueryString["endtime"].ToString();

                    BindData(begintime, endtime);
                }
                catch (Exception ex)
                {
                    UDS.Components.Error.Log(ex.Message);
                    Server.Transfer("../Error.aspx");
                }
            }
        }
Beispiel #3
0
        private void DutyOperation()
        {
            //try
            //{
                WA_Duty wd = new WA_Duty(Int32.Parse(Request.Cookies["UserID"].Value.Trim()));
                int Duty = wd.HaveCompletedDuty(DateTime.Now);
                //��鵱���Ƿ��Ѿ�����ϰ࿼��
                if(Duty==-1)
                {
                    if(wd.CheckStatus(DutyAction.OnDuty)) //û�гٵ�
                    {
                        wd.RecordOnDutyData(DateTime.Now,true,"").ToString();
                        //������ҳ���ʾ�ɹ�
                        Response.Write("<script language=javascript>window.open('../WorkAttendance/checksucessful.aspx?login=in','_blank','height=200,width=400,status=no,toolbar=no,menubar=no,location=no')</script>");
                    }
                    else//�ٵ�
                    {
                        //��ת����д����ҳ��
                        Response.Redirect("../WorkAttendance/Default.aspx?notnormal=1&login=in");
                    }

                }
            //}
            //catch(Exception ex)
            //{
            //    //UDS.Components.Error.Log(ex.Message);
            //    //Server.Transfer("../Error.aspx");
            //}
        }
Beispiel #4
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //
            indaycolor = "#EBFFE5";
            outdaycolor = "#ffffef";
            if(!Page.IsPostBack)
            {
                try
                {

                    UDS.Components.WA_Duty wa = new UDS.Components.WA_Duty();
                    string begintime,endtime;
                    begintime = (Request.QueryString["begintime"]==null)?DateTime.Now.ToString():Request.QueryString["begintime"].ToString();
                    endtime = (Request.QueryString["endtime"]==null)?DateTime.Now.ToString():Request.QueryString["endtime"].ToString();

                    BindData(begintime,endtime);
                }
                catch(Exception ex)
                {
                    UDS.Components.Error.Log(ex.Message);
                    Server.Transfer("../Error.aspx");
                }
            }
        }
Beispiel #5
0
        protected void btnCheckAttendance_Click(object sender, System.EventArgs e)
        {
            try
            {
                WA_Duty wd = new WA_Duty(Int32.Parse(Request.Cookies["UserID"].Value.Trim()));
                //��鵱���Ƿ��Ѿ���ɿ���
                int Duty = wd.HaveCompletedDuty(DateTime.Now);
                if(Duty==0)
                {
                    lblDutyMessage.Text = "���Ѿ�����˽���Ŀ��ڣ�";
                    btnCheckAttendance.Visible = false;

                }
                else
                {
                    //����Ƿ�ٵ�����
                    if(DutyStatus==true) //�ϰ࿼��
                    {
                        if(((Button)(sender)).CommandArgument.ToString()!="notnormal")
                        {
                            if(wd.CheckStatus(DutyAction.OnDuty))
                            {
                                wd.RecordOnDutyData(DateTime.Now,true,"").ToString();
                                lblDutyMessage.Text = "�����ϰ�û�гٵ������ڳɹ���";
                                btnCheckAttendance.Visible = false;
                                DutyStatus = false;
                            }
                            else
                            {
                                lblDutyMessage.Text = "�ϰ�ٵ�������д���ɣ�";
                                txtAttendanceMemo.Visible = true;
                                btnCheckAttendance.Text = "�ϰ�";
                                btnCheckAttendance.CommandArgument = "notnormal";
                            }
                        }
                        else
                        {
                            wd.RecordOnDutyData(DateTime.Now,false,txtAttendanceMemo.Text).ToString();
                            lblDutyMessage.Text = "�ϰ�ٵ������ڳɹ���";
                            txtAttendanceMemo.Visible = false;
                            btnCheckAttendance.Visible = false;
                            DutyStatus = false;
                            btnCheckAttendance.CommandArgument = "";
                        }
                    }
                    else  //�°࿼��
                    {
                        if(((Button)(sender)).CommandArgument.ToString()!="notnormal")
                        {
                            if(wd.CheckStatus(DutyAction.OffDuty))
                            {
                                wd.RecordOffDutyData(Duty,DateTime.Now,true,"");
                                lblDutyMessage.Text = "�����°�û�����ˡ����ڳɹ���";
                                btnCheckAttendance.Visible = false;
                                DutyStatus = true;
                            }
                            else
                            {
                                lblDutyMessage.Text = "�°����ˣ�����д���ɣ�";
                                txtAttendanceMemo.Visible = true;
                                btnCheckAttendance.Text = "�°�";
                                btnCheckAttendance.CommandArgument = "notnormal";
                            }
                        }
                        else
                        {
                            wd.RecordOffDutyData(Duty,DateTime.Now,false,txtAttendanceMemo.Text);
                            lblDutyMessage.Text = "�°����ˡ����ڳɹ���";
                            txtAttendanceMemo.Visible = false;
                            btnCheckAttendance.Visible = false;
                            DutyStatus = true;
                            btnCheckAttendance.CommandArgument = "";
                        }

                    }
                }
                GridBind();
            }
            catch(Exception ex)
            {
                UDS.Components.Error.Log(ex.Message);
                Server.Transfer("../Error.aspx");
            }
        }
Beispiel #6
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                staffid = Int32.Parse(Request.Cookies["UserID"].Value.Trim());
                //����û���½���ٵ�
                if(Request.QueryString["notnormal"]!=null)
                {
                    if((Request.QueryString["login"]!=null) &&(Request.QueryString["login"].ToString()=="in" ))
                    {
                        btnCheckAttendance.Text = "�ϰ�";
                        DutyStatus = true;
                        btnCheckAttendance.CommandArgument = "notnormal";
                        lblDutyMessage.Text = "�ϰ�ٵ�������д���ɣ�";
                        txtAttendanceMemo.Visible = true;
                    }
                    else if((Request.QueryString["login"]!=null) &&(Request.QueryString["login"].ToString()=="out" ))
                    {
                        btnCheckAttendance.Text = "�°�";
                        DutyStatus = false;
                        btnCheckAttendance.CommandArgument = "notnormal";
                        lblDutyMessage.Text = "�°����ˣ�����д���ɣ�";
                        txtAttendanceMemo.Visible = true;
                    }

                }
                else  //����û��Ƿ��Ѿ�����
                {
                    WA_Duty wd = new WA_Duty(Int32.Parse(Request.Cookies["UserID"].Value.Trim()));
                    if(wd.HaveCompletedDuty(DateTime.Now)==0 )
                    {
                        lblDutyMessage.Text = "���Ѿ�����˽���Ŀ��ڣ�";
                        btnCheckAttendance.Visible = false;

                    }
                    else
                    {
                        if(!wd.HaveCheckedDuty(DateTime.Now))
                        {
                            btnCheckAttendance.Text = "�ϰ�";
                            DutyStatus = true;
                        }
                        else
                        {
                            btnCheckAttendance.Text = "�°�";
                            DutyStatus = false;
                        }
                    }
                }
                //��ʾʱ��
                lbl_Hour.Text = DateTime.Now.Hour.ToString();
                lbl_Minute.Text = DateTime.Now.Minute.ToString();
                lbl_Second.Text = DateTime.Now.Second.ToString();
                //��ʾ�����ڵĿ�������
                GridBind();
                 //btnCheckAttendance_Click(null, null);
            }
            else
            {
                btnCheckAttendance.Text = "���ڴ����������";
            }
        }