Example #1
0
    private void SaveData()
    {
        long lnId = 0;

        if (hfIsUpdate.Value == "Y")
        {
            lnId = Convert.ToInt64(hfReHiredId.Value);
        }
        else
        {
            lnId = objDB.GerMaxIDNumber("EmpReHiredLog", "ReHiredId");
        }

        string strEffDate = "";

        if (string.IsNullOrEmpty(txtEffDate.Text.Trim()) == false)
        {
            strEffDate = Common.ReturnDate(txtEffDate.Text.Trim());
        }

        clsContractExt objReHired = new clsContractExt(txtEmpID.Text.Trim(), lnId.ToString(), ddlAction.SelectedValue.ToString(), strEffDate,
                                                       Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()));

        EmpInfoManager objEmp = new EmpInfoManager();

        objEmp.InsertReHiredLog(objReHired, txtPayEmpId.Text.Trim(), ddlAction.SelectedItem.ToString(), hfIsUpdate.Value);

        if (hfIsUpdate.Value == "N")
        {
            lblMsg.Text = "Record Saved Successfully";
        }

        else if (hfIsUpdate.Value == "Y")
        {
            lblMsg.Text = "Record Updated Successfully";
        }

        else
        {
            lblMsg.Text = "";
        }



        this.OpenRecord();
        this.EntryText();
        this.EntryMode(false);
    }
Example #2
0
 protected void txtEmpId_TextChanged(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtEmpId.Text.Trim()) == false)
     {
         EmpInfoManager objEmp      = new EmpInfoManager();
         DataTable      dtEmpInfoHr = objEmp.SelectEmpInfoHR(txtEmpId.Text.Trim());
         if (dtEmpInfoHr.Rows.Count > 0)
         {
             txtUserName.Text = dtEmpInfoHr.Rows[0]["FullName"].ToString().Trim();
         }
         else
         {
             txtUserName.Text = "";
             lblMsg.Text      = "Invalid User ID.";
         }
     }
 }
Example #3
0
    protected void SaveData()
    {
        string IsDelete = "N";

        if ((hfIsUpdate.Value == "Y") || (IsDelete == "Y"))
        {
            hfSepId.Value = hfSepId.Value;
        }
        else
        {
            hfSepId.Value = Common.getMaxId("EmpSeparationLog", "SeparationId");
        }

        string strSepDate = "";

        if (string.IsNullOrEmpty(txtSepDate.Text.Trim()) == false)
        {
            strSepDate = Common.ReturnDate(txtSepDate.Text.Trim());
        }

        ClsEmpSeparation objEmpSep = new ClsEmpSeparation(txtEmpID.Text.Trim(), hfSepId.Value.ToString(), ddlAction.SelectedValue.ToString(),
                                                          strSepDate, txtPWD.Text.Trim(), chkIsNotRehire.Checked == true ?"Y":"N", txtReHire.Text.Trim(), txtReHCause.Text.Trim(), txtRemarks.Text.Trim(),
                                                          Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()));

        EmpInfoManager objEmp = new EmpInfoManager();

        objEmp.InsertEmpSeparation(objEmpSep, ddlAction.SelectedItem.ToString(), hfIsUpdate.Value, IsDelete,
                                   (hfSLYear.Value != "" ? hfSLYear.Value.ToString() : "0"),
                                   (hfSLMonth.Value != "" ? hfSLMonth.Value.ToString() : "0"),
                                   (hfSLDay.Value != "" ? hfSLDay.Value.ToString() : "0"),
                                   (hfTotDays.Value != "" ? hfTotDays.Value.ToString() : "0"), hfLPakId.Value.ToString());

        if ((hfIsUpdate.Value == "N") && (IsDelete == "N"))
        {
            lblMsg.Text = "Record Saved Successfully";
        }
        else if ((hfIsUpdate.Value == "Y") && (IsDelete == "N"))
        {
            lblMsg.Text = "Record Updated Successfully";
        }

        //this.OpenRecord();
        this.EntryMode(false);
        this.ClearControls();
    }
Example #4
0
    private void SaveData()
    {
        if (hfIsUpdate.Value == "Y")
        {
            hfContExtId.Value = hfContExtId.Value;
        }
        else
        {
            hfContExtId.Value = Common.getMaxId("EmpContractExtLog", "ContractExtId");
        }

        string strEffDate     = "";
        string strContExtDate = "";

        if (string.IsNullOrEmpty(txtEffDate.Text.Trim()) == false)
        {
            strEffDate = Common.ReturnDate(txtEffDate.Text.Trim());
        }

        if (string.IsNullOrEmpty(txtContExpDate.Text.Trim()) == false)
        {
            strContExtDate = Common.ReturnDate(txtContExpDate.Text.Trim());
        }

        clsContractExt objContExt = new clsContractExt(txtEmpID.Text.Trim(), hfContExtId.Value.ToString(), ddlAction.SelectedValue.ToString(), strEffDate, strContExtDate,
                                                       Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()));

        EmpInfoManager objEmp = new EmpInfoManager();

        objEmp.InsertContractExtension(objContExt, ddlAction.SelectedItem.ToString(), hfIsUpdate.Value);

        if (hfIsUpdate.Value == "N")
        {
            lblMsg.Text = "Record Saved Successfully";
        }

        else if (hfIsUpdate.Value == "Y")
        {
            lblMsg.Text = "Record Updated Successfully";
        }

        this.OpenRecord();
        this.EntryMode(false);
        this.ClearControl();
    }
        private void SendMail(string totalDays)
        {
            MailManagerSmtpClient mailManager = new MailManagerSmtpClient();
            EmpInfoManager        empManager  = new EmpInfoManager();

            mailManager.strFromAddr = "";
            mailManager.strToAddr   = "";
            //mailManager.MailServer = ConfigurationManager.AppSettings["MyMailServer"].ToString();
            //mailManager.MailPort = Convert.ToInt32(ConfigurationManager.AppSettings["MyMailServerPort"]);
            //mailManager.SystemEmailUserName = ConfigurationManager.AppSettings["MyEmailUserName"].ToString();
            //mailManager.SystemEmailPwd = ConfigurationManager.AppSettings["MyEmailPwd"].ToString();
            //mailManager.Enablessl = ConfigurationManager.AppSettings["Enssl"].ToString().Trim();

            mailManager.strSubject = "Request to Verify Travel Recommendation";

            //+ " Total Days : " + totalDays + ","
            mailManager.strBody = "Please verify the Application "
                                  + " \n "
                                  + " \n\n "
                                  + "With thanks "
                                  + " \n\n ";

            DataTable empUserFrom = new DataTable();
            DataTable empUserTo   = new DataTable();

            empUserFrom = empManager.SelectEmpInfo(Session["EMPID"].ToString());
            if (empUserFrom.Rows.Count > 0)
            {
                mailManager.strFromAddr = empUserFrom.Rows[0]["OfficeEmail"].ToString();
                //mailManager.strFromAddr = "*****@*****.**";
                mailManager.strBody += empUserFrom.Rows[0]["FullName"].ToString() + " \n ";
            }
            empUserTo = empManager.SelectEmpInfo(empUserFrom.Rows[0]["SupervisorId"].ToString());
            if (empUserTo.Rows.Count > 0)
            {
                mailManager.strToAddr = empUserTo.Rows[0]["OfficeEmail"].ToString();
                //mailManager.strToAddr = "*****@*****.**";
            }
            string strVPath = "http://10.0.1.70:82/LogIn";

            mailManager.strBody += " \n ======================================\n"
                                   + " Click here to login for recommendation: " + strVPath;
            mailManager.SendMSBMail();
        }
        private void SendMail(string applicant)
        {
            MailManagerSmtpClient mailManager = new MailManagerSmtpClient();
            EmpInfoManager        empManager  = new EmpInfoManager();

            mailManager.strFromAddr = "";
            mailManager.strToAddr   = "";
            //mailManager.MailServer = ConfigurationManager.AppSettings["MyMailServer"].ToString();
            //mailManager.MailPort = Convert.ToInt32(ConfigurationManager.AppSettings["MyMailServerPort"]);
            //mailManager.SystemEmailUserName = ConfigurationManager.AppSettings["MyEmailUserName"].ToString();
            //mailManager.SystemEmailPwd = ConfigurationManager.AppSettings["MyEmailPwd"].ToString();
            //mailManager.Enablessl = ConfigurationManager.AppSettings["Enssl"].ToString().Trim();

            mailManager.strSubject = "Travel Approval";

            mailManager.strBody = "Your travel Application has been Approved. "
                                  + " \n "
                                  + " \n\n "
                                  + "With thanks "
                                  + " \n\n ";

            DataTable empUserFrom = new DataTable();
            DataTable empUserTo   = new DataTable();

            empUserFrom = empManager.SelectEmpInfo(Session["EMPID"].ToString());
            if (empUserFrom.Rows.Count > 0)
            {
                mailManager.strFromAddr = empUserFrom.Rows[0]["OfficeEmail"].ToString();
                //mailManager.strFromAddr = "*****@*****.**";
                mailManager.strBody += empUserFrom.Rows[0]["FullName"].ToString() + " \n ";
            }
            empUserTo = empManager.SelectEmpInfo(applicant);
            if (empUserTo.Rows.Count > 0)
            {
                mailManager.strToAddr = empUserTo.Rows[0]["OfficeEmail"].ToString();
                //mailManager.strToAddr = "*****@*****.**";
            }
            string strVPath = "http://10.0.1.70:82/LogIn";

            mailManager.strBody += " \n ======================================\n"
                                   + " Click here to login: " + strVPath;
            mailManager.SendMSBMail();
        }
Example #7
0
    public List <clsEmpInfo> GetEmployee(string empname)
    {
        EmpInfoManager objEmpInfoMgr = new EmpInfoManager();

        DataRow[]         emprows = objEmpInfoMgr.SelectEmpNameWithID("").Select("EMPNAME like '%" + empname + "%'");
        List <clsEmpInfo> emplist = new List <clsEmpInfo>();
        int i = 0;

        foreach (var item in emprows)
        {
            i++;
            clsEmpInfo emp = new clsEmpInfo(item["EMPID"].ToString(), item["DesigName"].ToString(), item["EMPNAME"].ToString(), "", "", "", "", "",
                                            "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
                                            "", "", "", "", "", "", "", "", "", "", "", "", "", "");
            emp.DeptName = item["DeptName"].ToString();
            emplist.Add(emp);
            if (i > 100)
            {
                break;
            }
        }
        return(emplist);
    }