コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objgen.validatelogin();

            if (!IsPostBack)
            {
                if (!objda.checkUserInroles("84") && !objda.checkUserInroles("70"))
                {
                    Response.Redirect("UserDashboard.aspx");
                }

                txtfrmdate.Text = Convert.ToDateTime(GeneralMethod.getLocalDate()).AddDays(-7).ToString("MM/dd/yyyy");
                txttodate.Text  = GeneralMethod.getLocalDate();


                if (Request.QueryString["report"] != null)
                {
                    reportname.Text = Request.QueryString["report"].ToString();
                }
                if (Request.QueryString["reportname"] != null)
                {
                    reportname1.Text = Request.QueryString["reportname"].ToString();
                }


                fillemployee();
                fillclient();
                fillproject();
                fillmanager();
            }
        }
コード例 #2
0
 //Save announcment details
 protected void btnsubmit_Click(object sender, EventArgs e)
 {
     objda.action      = "insert";
     objda.id          = hidid.Value;
     objda.name        = txttitle.Text;
     objda.company     = Session["CompanyId"].ToString();
     objda.description = txtdesc.Text;
     objda.dob         = txtdisplayon.Text;
     objda.dob2        = GeneralMethod.getLocalDate();
     objda.loginid     = Session["userid"].ToString();
     objda.imgPath     = Announcement_hidicon.Value;
     //Here user type parameter to Show Announcement on login page
     if (chkavailableToLogin.Checked == true)
     {
         objda.usertype = "1";
     }
     else
     {
         objda.usertype = "0";
     }
     ds = objda.AnnouncementMaster();
     blank();
     fillgrid();
     ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>alert('Saved Successfully.');</script>", false);
 }
コード例 #3
0
 public void blank()
 {
     hidid.Value            = "";
     txttitle.Text          = "";
     txtdesc.Text           = "";
     txtdisplayon.Text      = GeneralMethod.getLocalDate();
     tradded.Visible        = false;
     btnsubmit.Text         = "Save";
     legendaction.InnerHtml = "Add New Announcement";
 }
コード例 #4
0
 /// <summary>
 /// Blank Values
 /// </summary>
 public void blank()
 {
     txtpopfrdate.Text          = Convert.ToDateTime(GeneralMethod.getLocalDate()).ToString("MM/dd/yyyy");
     txtpoptodate.Text          = Convert.ToDateTime(GeneralMethod.getLocalDate()).ToString("MM/dd/yyyy");
     drppopclient.SelectedIndex = 0;
     drppophour.SelectedIndex   = 0;
     drppopmin.SelectedIndex    = 0;
     drppopstatus.SelectedIndex = 0;
     listcode1.Items.Clear();
     listcode2.Items.Clear();
     hidexpense.Value = "";
     popbindexpensesList();
     ddlproject.SelectedIndex = 0;
     rdbtnscheduleType.ClearSelection();
     txtaddremark.Text = "";
     ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>showhidestatus();</script>", false);
 }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objgen.validatelogin();
            if (!Page.IsPostBack)
            {
                if (objda.checkUserInroles("101"))
                {
                    Att_hidAdd.Value = "1";
                }
                if (objda.checkUserInroles("102"))
                {
                    Att_hidview.Value = "1";
                }
                if (objda.checkUserInroles("103"))
                {
                    Att_hidViewOthers.Value = "1";
                }


                if (Att_hidAdd.Value != "1" && Att_hidview.Value != "1" && Att_hidViewOthers.Value != "1")
                {
                    Response.Redirect("UserDashboard.aspx");
                }

                if (Att_hidAdd.Value != "1")
                {
                    linkaddnew.Visible = false;
                }



                //role 9 indicates Approve Task
                if (!objda.checkUserInroles("10"))
                {
                    linkaddnew.Visible = false;
                }

                string todaydate = GeneralMethod.getLocalDate();

                txtfrom.Text = System.DateTime.Now.AddDays(-6).ToString("MM/dd/yyyy");
                txtto.Text   = System.DateTime.Now.ToString("MM/dd/yyyy");
                txtdate.Text = System.DateTime.Now.ToString("MM/dd/yyyy");
                // fillgrid();
                fillemployee();
            }
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Ajax.Utility.RegisterTypeForAjax(typeof(Timesheet));
            objgen.validatelogin();
            if (!Page.IsPostBack)
            {
                //role 9 indicates Approve Task
                if (objda.checkUserInroles("7"))
                {
                    ViewState["add"] = "1";
                }
                else
                {
                    ViewState["add"] = null;
                }
                if (objda.checkUserInroles("25"))
                {
                    ViewState["approvetimesheet"] = "1";
                    btnapprove.Visible            = true;
                    btnreject.Visible             = true;
                }
                else
                {
                    ViewState["approvetimesheet"] = null;
                    btnapprove.Visible            = false;
                    btnreject.Visible             = false;
                }
                hidcompanyid.Value = Session["companyid"].ToString();
                hiduserid.Value    = Session["userid"].ToString();

                string todaydate = GeneralMethod.getLocalDate();

                txtfrom.Text = System.DateTime.Now.AddDays(-7).ToString("MM/dd/yyyy");
                txtto.Text   = System.DateTime.Now.ToString("MM/dd/yyyy");

                hidrowno.Value = "0";
                fillemployee();
                fillproject();
                fillexpenses();
                fillexpenses1();
                hidsno.Value = "1";
                strsno       = "1";
                searchdata();
            }
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objgen.validatelogin();

            if (!IsPostBack)
            {
                if (!objda.checkUserInroles("114"))
                {
                    Response.Redirect("UserDashboard.aspx");
                }

                txtfrmdate.Text = Convert.ToDateTime(GeneralMethod.getLocalDate()).AddDays(-7).ToString("MM/dd/yyyy");
                txttodate.Text  = GeneralMethod.getLocalDate();

                fillclient();
                fillproject();
            }
        }
コード例 #8
0
        public static string getEmpAvailability(string empid)
        {
            string         msg    = "failure";
            GeneralMethod  objgen = new GeneralMethod();
            DataSet        ds     = new DataSet();
            ClsAppointment obj    = new ClsAppointment();

            try
            {
                obj.aDate = GeneralMethod.getLocalDate();

                obj.empid = empid;


                ds  = obj.APP_getAvailability();
                msg = ds.Tables[0].Rows[0][0].ToString();
                return(msg);
            }
            catch { return(msg); }
        }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objgen.validatelogin();
            if (!Page.IsPostBack)
            {
                txtinvoicedate.Text = System.DateTime.Now.ToString("MM/dd/yyyy");
                //role 37 indicates Create Invoice
                if (!objda.checkUserInroles("37"))
                {
                    Response.Redirect("UserDashboard.aspx");
                }
                hidrowno.Value = "0";
                filltaxmaster();
                bindmaxinvoice();
                fillcurrency();
                // fillproject();
                filltasks();
                hidsno.Value        = "1";
                strsno              = "1";
                txtinvoicedate.Text = GeneralMethod.getLocalDate();
                if (Request.QueryString["invoiceid"] != null && Request.QueryString["invoiceid"].ToString() != "")
                {
                    objts.nid       = Request.QueryString["invoiceid"].ToString();
                    objts.invoiceno = "";
                    objts.companyId = Session["companyid"].ToString();
                    objts.action    = "selectinvoicebynumber";
                    ds = objts.GetInvoice();
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        hidid.Value = Request.QueryString["invoiceid"].ToString();
                        // h1headr.InnerHtml = "Update Invoice";
                        txtinvoicenum.Text    = ds.Tables[0].Rows[0]["invoiceno"].ToString();
                        txtinvoicenum.Enabled = false;
                    }

                    //ScriptManager.RegisterStartupScript(Page, typeof(Page), "MyKey", "<script type='text/javascript'> $(document).ready(function () {bindinvoicebynumber('" + hidid.Value + "','nid'); });</script>", false);
                }
            }
        }
コード例 #10
0
        public static string getEmpMonthlyDetail(string empid)
        {
            DataAccess    objda  = new DataAccess();
            GeneralMethod objgen = new GeneralMethod();

            DataSet ds  = new DataSet();
            string  msg = "failure";

            try
            {
                objda.id    = Convert.ToDateTime(GeneralMethod.getLocalDate()).Year.ToString();
                objda.empid = empid;
                ds          = objda.getEmptimeMonthwise();
                msg         = objgen.serilizeinJson(ds.Tables[0]);
                return(msg);
            }
            catch (Exception ex)
            {
                //msg = ex.Message.ToString();
                return(msg);
            }
        }
コード例 #11
0
        public static string getLeaveDetail(string empid)
        {
            ClsPayroll    objpayroll = new ClsPayroll();
            GeneralMethod objgen     = new GeneralMethod();

            DataSet ds  = new DataSet();
            string  msg = "failure";

            try
            {
                objpayroll.action  = "getleavedetail";
                objpayroll.Date    = GeneralMethod.getLocalDate();
                objpayroll.loginid = empid;
                ds  = objpayroll.LeaveRequest();
                msg = objgen.serilizeinJson(ds.Tables[0]);
                return(msg);
            }
            catch (Exception ex)
            {
                //msg = ex.Message.ToString();
                return(msg);
            }
        }
コード例 #12
0
        public static string getChartReport(string action, string companyid)
        {
            DataAccess    objda  = new DataAccess();
            GeneralMethod objgen = new GeneralMethod();

            DataSet ds  = new DataSet();
            string  msg = "failure";

            try
            {
                objda.id      = Convert.ToDateTime(GeneralMethod.getLocalDate()).Year.ToString();
                objda.action  = action;
                objda.id      = DateTime.Now.Year.ToString();
                objda.company = companyid;
                ds            = objda.getchartreport();
                msg           = objgen.serilizeinJson(ds.Tables[0]);
                return(msg);
            }
            catch (Exception ex)
            {
                //msg = ex.Message.ToString();
                return(msg);
            }
        }
コード例 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objgen.validatelogin();
            if (!Page.IsPostBack)
            {
                //role 9 indicates Approve Task
                if (objda.checkUserInroles("85"))
                {
                    ViewState["add"] = "1";
                }
                else
                {
                    ViewState["add"]       = null;
                    divtableaddnew.Visible = false;
                }
                if (objda.checkUserInroles("25"))
                {
                    ViewState["approvetimesheet"] = "1";
                    btnapprove.Visible            = true;
                    btnreject.Visible             = true;
                    timesheet_hidisapprove.Value  = "1";
                    editcellnum = 13;
                }
                else
                {
                    ViewState["approvetimesheet"] = null;
                    timesheet_hidisapprove.Value  = "0";
                    btnapprove.Visible            = false;
                    btnreject.Visible             = false;
                    dgnews.Columns[9].Visible     = false;
                    dgnews.Columns[10].Visible    = false;
                }
                hidcompanyid.Value = Session["companyid"].ToString();
                hiduserid.Value    = Session["userid"].ToString();

                ClsUser       objuser = new ClsUser();
                DataSet       ds      = new DataSet();
                GeneralMethod objgen  = new GeneralMethod();

                objuser.fname        = "";
                objuser.action       = "select";
                objuser.companyid    = hidcompanyid.Value;
                objuser.id           = hiduserid.Value;
                objuser.activestatus = "";
                objuser.deptid       = "";
                ds = objuser.ManageEmployee();
                timesheet_joindate.Value = ds.Tables[0].Rows[0]["joinDate"].ToString();
                hdnjoinDate_byEmp.Value  = ds.Tables[0].Rows[0]["joinDate"].ToString();

                string todaydate = GeneralMethod.getLocalDate();

                txtfrom.Text = System.DateTime.Now.AddDays(-7).ToString("MM/dd/yyyy");
                txtto.Text   = System.DateTime.Now.ToString("MM/dd/yyyy");

                timesheet_hidrowno.Value = "0";
                fillemployee();
                fillemployeesll();
                fillproject();
                timesheet_hidsno.Value = "1";
                strsno = "1";
                searchdata();
            }
            else if (this.ViewState["fillemployee"] != null)
            {
                fillviewStatetable();
            }
        }
コード例 #14
0
        protected void txtleavedate_TextChanged(object sender, EventArgs e)
        {
            //txtleavedate.Text = System.DateTime.Now.ToString("MM/dd/yyyy");

            DateTime leavedate;

            if (!DateTime.TryParseExact(txtleavedate.Text, "MM/dd/yyyy",
                                        System.Globalization.CultureInfo.InvariantCulture,
                                        System.Globalization.DateTimeStyles.None,
                                        out leavedate))
            {
                txtleavedate.Text = GeneralMethod.getLocalDate();
                ScriptManager.RegisterStartupScript(this, GetType(), "key", "<script type='text/javascript'>alert('Invalid Date');</script>", false);
                updateleavestatus.Update();
                return;
            }


            objpayroll.Empid = "";
            objpayroll.from  = "";

            objpayroll.to          = "";
            objpayroll.Status      = "";
            objpayroll.Leavetypeid = "";
            objpayroll.companyid   = Session["companyid"].ToString();
            objpayroll.action      = "getleavedetail";
            objpayroll.RequestDate = txtleavedate.Text;

            if (txtleavedate.Text == "")
            {
                objpayroll.Date = System.DateTime.Now.ToString("MM/dd/yyyy");
            }
            else
            {
                objpayroll.Date = txtleavedate.Text;
            }
            objpayroll.nid     = "";
            objpayroll.loginid = Session["userid"].ToString();
            ds = objpayroll.LeaveRequest();

            if (ds.Tables[0].Rows.Count > 0)
            {
                litpl.Text = ds.Tables[0].Rows[0]["noofpaid"].ToString();

                litapl.Text       = ds.Tables[0].Rows[0]["totalacc"].ToString();
                littakenpl.Text   = ds.Tables[0].Rows[0]["totalpaid"].ToString();
                littakenupl.Text  = ds.Tables[0].Rows[0]["unpaidleave"].ToString();
                litbalancepl.Text = ds.Tables[0].Rows[0]["remAcc"].ToString();



                hidaccleave.Value = ds.Tables[0].Rows[0]["remAcc"].ToString();
                if (ds.Tables[0].Rows[0]["isapppaid"].ToString() == "No")
                {
                    for (int i = 0; i < ddlleavetype.Items.Count; i++)
                    {
                        if (ddlleavetype.Items[i].Value == "1" || ddlleavetype.Items[i].Value == "5")
                        {
                            ddlleavetype.Items[i].Attributes.Add("style", "display:none;");
                        }
                    }
                }

                if (txtleavedate.Text == "")
                {
                    litleavestatus.Text = System.DateTime.Now.ToString("MM/dd/yyyy");
                }
                else
                {
                    litleavestatus.Text = txtleavedate.Text;
                }
                updateleavestatus.Update();
                ScriptManager.RegisterStartupScript(this, GetType(), "key", "<script type='text/javascript'>resetleave();</script>", false);
            }
        }