示例#1
0
    private void Loadvendor()
    {
        DataTable   dt   = new DataTable();
        XmlDocument xDoc = new XmlDocument();

        API.Service web = new API.Service();
        xDoc.LoadXml("<XML>" + web.get_vendor(Session["ClientID"].ToString(), Session["Email"].ToString(), Session["P@ss"].ToString()).InnerXml + "</XML>");
        XmlNodeList iResponse = xDoc.SelectNodes("XML/RESPONSE/VENDOR_ID");

        dt.Columns.Add("VENDOR_NAME", typeof(string));
        dt.Columns.Add("VENDOR_ID", typeof(string));
        foreach (XmlNode node in iResponse)
        {
            DataRow dr = dt.NewRow();
            dr["VENDOR_NAME"] = node["VENDOR_NAME"].InnerText;
            dr["VENDOR_ID"]   = node["VENDOR_ID"].InnerText;
            dt.Rows.Add(dr);
        }
        ddlvendor.DataSource     = dt;
        ddlvendor.DataTextField  = "vendor_name";
        ddlvendor.DataValueField = "VENDOR_ID";
        ddlvendor.DataBind();
        // ddlvendor.Items.Insert(0, new ListItem("ALL VENDORS", "0"));
        //ddlvendor.Items.Insert(0, new ListItem("-- Select --", "0"));
        ddlvendor.Items.Insert(0, new ListItem("ALL VENDORS", "4"));
    }
示例#2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (txtnewpass.Text == "" || txtcompass.Text == "")
     {
         Label1.Text      = "*Fields can not be empty";
         Label1.ForeColor = System.Drawing.Color.Red;
         Label1.Focus();
     }
     else
     {
         if (txtnewpass.Text != txtcompass.Text)
         {
             Label1.Text      = "*Passwords do not match";
             Label1.ForeColor = System.Drawing.Color.Red;
             Label1.Focus();
         }
         else
         {
             XmlDocument xmldoc  = new XmlDocument();
             API.Service updateP = new API.Service();
             xmldoc.LoadXml("<XML>" + updateP.update_Personal_Profile(Session["Email"].ToString(), Session["P@ss"].ToString(), Session["UserID"].ToString(), txtnewpass.Text).InnerXml + "</XML>");
             Session["P@ss"] = "";
             Session["P@ss"] = txtnewpass.Text;
             Response.Redirect("V_settings.aspx");
         }
     }
 }
示例#3
0
    private void Loaddepartment()
    {
        DataTable dt = new DataTable();

        //string sTable = "<tbody>";
        API.Service web  = new API.Service();
        XmlDocument xDoc = new XmlDocument();

        xDoc.LoadXml("<XML>" + web.get_department(Session["Email"].ToString(), Session["P@ss"].ToString(), "", Session["ClientID"].ToString()).InnerXml + "</XML>");
        XmlNodeList iResponse = xDoc.SelectNodes("XML/RESPONSE/DEPARTMENT_ID");

        dt.Columns.Add("DEPARTMENT_NAME", typeof(string));
        dt.Columns.Add("DEPARTMENT_ID", typeof(string));
        foreach (XmlNode node in iResponse)
        {
            DataRow dr = dt.NewRow();
            dr["DEPARTMENT_NAME"] = node["DEPARTMENT_NAME"].InnerText;
            dr["DEPARTMENT_ID"]   = node["DEPARTMENT_ID"].InnerText;
            dt.Rows.Add(dr);
        }
        ddldepartment.DataSource     = dt;
        ddldepartment.DataTextField  = "DEPARTMENT_NAME";
        ddldepartment.DataValueField = "DEPARTMENT_ID";
        ddldepartment.DataBind();
    }
示例#4
0
    private void Loadpositiontype()
    {
        DataTable dt = new DataTable();
        //string sTable = "<tbody>";
        XmlDocument xDoc = new XmlDocument();

        API.Service web = new API.Service();
        xDoc.LoadXml("<XML>" + web.get_job_position_type_MB(Session["Email"].ToString(), Session["P@ss"].ToString(), "3").InnerXml + "</XML>");
        //  xDoc.LoadXml("<XML>" + web.get_job_position_type(Session["Email"].ToString(), Session["P@ss"].ToString(), "3").InnerXml + "</XML>");
        XmlNodeList iResponse = xDoc.SelectNodes("XML/RESPONSE/JOB_POSITION_TYPE_ID");

        dt.Columns.Add("JOB_POSITION_TYPE", typeof(string));
        dt.Columns.Add("JOB_POSITION_TYPE_ID", typeof(string));
        foreach (XmlNode node in iResponse)
        {
            DataRow dr = dt.NewRow();
            dr["JOB_POSITION_TYPE"]    = node["JOB_POSITION_TYPE"].InnerText;
            dr["JOB_POSITION_TYPE_ID"] = node["JOB_POSITION_TYPE_ID"].InnerText;
            dt.Rows.Add(dr);
        }
        ddlpositiontype.DataSource     = dt;
        ddlpositiontype.DataTextField  = "JOB_POSITION_TYPE";
        ddlpositiontype.DataValueField = "JOB_POSITION_TYPE_ID";
        ddlpositiontype.DataBind();
    }
    private void ViewJobsInTable()
    {
        string sTable = "<tbody>";

        API.Service jobInfo = new API.Service();
        XmlDocument xmldoc  = new XmlDocument();

        //xmldoc.LoadXml("<XML>" + jobInfo.get_JobView("*****@*****.**", "ferivan", "2", "", "", "", "", "", "", "").InnerXml + "</XML>");
        xmldoc.LoadXml("<XML>" + jobInfo.get_Jobs("", Session["Email"].ToString(), Session["P@ss"].ToString(), "", Session["UserID"].ToString(), Session["ClientID"].ToString()).InnerXml + "</XML>");
        XmlNodeList Response = xmldoc.SelectNodes("XML/RESPONSE/JOBS ");

        sTable = "";
        int CountRows = 1;

        string _sBackground = "";

        for (int intCount = 0; intCount < Response.Count; intCount++)
        {
            sTable = sTable + "<tr " + _sBackground + ">";
            sTable = sTable + "<td>" + CountRows + "</td>";

            if (Response[intCount].SelectSingleNode("URGENT").InnerText == "1")
            {
                sTable = sTable + "<td style=color:red><blink>" + "Urgent" + "</blink> </td> ";
                sTable = sTable + "<td style=color:red><a style=color:red href='Client_Job_Details.aspx?jopen=Y&p=JV&jobID=" + Response[intCount].SelectSingleNode("JOB_ALIAS").InnerText + "'>" + Response[intCount].SelectSingleNode("JOB_ALIAS").InnerText + "</td>";
                sTable = sTable + "<td style=color:red>" + func.FixString(Server.HtmlDecode(Response[intCount].SelectSingleNode("JOB_TITLE").InnerText)) + "</td> ";
                sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("JOB_LOCATION").InnerText.Replace(",Canada", "") + " </td> ";
                sTable = sTable + "<td style=color:red>" + DateTime.Parse(Response[intCount].SelectSingleNode("CONTRACT_START_DATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";
                sTable = sTable + "<td style=color:red>" + DateTime.Parse(Response[intCount].SelectSingleNode("CONTRACT_END_DATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";
                sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("NO_OF_OPENINGS").InnerText + " </td> ";
                sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("HIRED").InnerText + " </td> ";
                sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("AVAILABLE_JOBS").InnerText + " </td> ";
                sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("RECENT").InnerText + " day(s)</td> ";
                sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("USERNAME").InnerText + " </td> ";
                sTable = sTable + "</tr>";
            }
            else
            {
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("JOB_STATUS").InnerText + "</td>";
                sTable = sTable + "<td><a href='Client_Job_Details.aspx?jopen=Y&p=JV&jobID=" + Response[intCount].SelectSingleNode("JOB_ALIAS").InnerText + "'>" + Response[intCount].SelectSingleNode("JOB_ALIAS").InnerText + "</td>";
                sTable = sTable + "<td>" + Server.HtmlDecode(Response[intCount].SelectSingleNode("JOB_TITLE").InnerText) + "</td> ";
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("JOB_LOCATION").InnerText.Replace(",Canada", "") + " </td> ";
                sTable = sTable + "<td>" + DateTime.Parse(Response[intCount].SelectSingleNode("CONTRACT_START_DATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";
                sTable = sTable + "<td>" + DateTime.Parse(Response[intCount].SelectSingleNode("CONTRACT_END_DATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("NO_OF_OPENINGS").InnerText + " </td> ";
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("HIRED").InnerText + " </td> ";
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("AVAILABLE_JOBS").InnerText + " </td> ";
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("RECENT").InnerText + " day(s)</td> ";
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("USERNAME").InnerText + " </td> ";
                sTable = sTable + "</tr>";
            }
            CountRows++;
        }

        sTable = sTable + "</tbody>";
        jobInfo.Dispose();
        lblTableData.Text = sTable;
    }
示例#6
0
 public void GetWeatherTest()
 {
     var service  = new API.Service();
     var dataPack = new DataPack()
     {
         Humidity = 54, IR1 = 1042, IR2 = 34, Temperature = 25, Name = "testSensor"
     };
     var list = service.GetWeather("Roskilde", APIXULib.MethodType.Current, APIXULib.Days.Eight);
 }
示例#7
0
        public void CreateUserTest()
        {
            var service        = new API.Service();
            var newStaffMember = new Staff()
            {
                Email = "testMail", Full_Name = "FullNameTest", Username = "******", Password = "******"
            };

            Assert.AreEqual("OK", service.CreateStaffUser(newStaffMember));
        }
示例#8
0
        public void GetDataByPeriodTest()
        {
            var service  = new API.Service();
            var dataList = service.GetDataByPeriod(DateTime.Now.AddDays(-15));

            if (dataList == null)
            {
                Assert.Fail();
            }
        }
示例#9
0
        public void SaveDataTest()
        {
            var service  = new API.Service();
            var dataPack = new DataPack()
            {
                Humidity = 54, IR1 = 1042, IR2 = 34, Temperature = 25, Name = "testSensor"
            };

            Assert.AreEqual("OK", service.SaveData(dataPack));
        }
    public string GetNumberOfWeeks()
    {
        string _sArrayString = "";

        //select first_name, last_name, email_id from ovms_users where user_id = 9
        conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString);
        try
        {
            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();



                API.Service timesheet = new API.Service();
                XmlDocument xmldoc    = new XmlDocument();
                xmldoc.LoadXml("<XML>" + timesheet.Add_TimeSheet(Session["EmailClient"].ToString(), Session["P@ssClient"].ToString(), Session["UserIDClient"].ToString()).InnerXml + "</XML>");
                string      FileName = Server.MapPath("temp") + "\\response_get_timesheet_" + DateTime.Now.Millisecond.ToString() + ".xml";
                XmlNodeList Response = xmldoc.SelectNodes("XML/RESPONSE/TIMESHEET");
                // string weeks;
                // string timesheetVariable = "";
                string jobID = "";
                jobID            = Response[0].SelectSingleNode("JOB_ID").InnerText;
                Session["JobID"] = jobID.ToString();

                //start, end and weeks
                string sqlGetStartEndWeeks = " select contract_Start_date, contract_end_date, " +
                                             " DATEDIFF(wk, contract_Start_date, contract_end_date + 7) as Num_weeks " +
                                             " from ovms_jobs where job_id =  " + Session["JobID"].ToString().Trim();
                SqlCommand    cmdStartEndWeeks = new SqlCommand(sqlGetStartEndWeeks, conn);
                SqlDataReader rsStartEndWeeks  = cmdStartEndWeeks.ExecuteReader();
                //string _svendorList = "";
                while (rsStartEndWeeks.Read())
                {
                    _sArrayString = rsStartEndWeeks["contract_Start_date"].ToString() + "," + rsStartEndWeeks["contract_end_date"].ToString() + "," + rsStartEndWeeks["Num_weeks"].ToString();
                }
                rsStartEndWeeks.Close();
                cmdStartEndWeeks.Dispose();
            }
        }
        catch (Exception ex)
        {
            //
        }
        finally
        {
            if (conn.State == System.Data.ConnectionState.Open)
            {
                conn.Close();
            }
        }
        return(_sArrayString);
    }
示例#11
0
        public void LogInTest()
        {
            var service  = new API.Service();
            var dataPack = new DataPack();
            var staff    = service.Login("usertest", Service.MD5("pass"));

            if (staff == null)
            {
                Assert.Fail();
            }
            Assert.AreEqual("usertest", staff.Username);
        }
示例#12
0
    private void ViewcandidateInTable()
    {
        string sTable = "<tbody>";

        API.Service getWorkers = new API.Service();
        // API.Service getWorkers = new API.Service();
        XmlDocument dom1 = new XmlDocument();

        dom1.LoadXml("<XML>" + getWorkers.get_employees(Session["Email"].ToString(), Session["P@ss"].ToString(), "", "", Session["ClientID"].ToString(), "", "", "1", "").InnerXml + "</XML>");
        XmlNodeList Response = dom1.SelectNodes("XML/RESPONSE/EMPLOYEE_NAME_ID");


        int CountRows = 1;

        sTable = "";
        string _sBackground = "";

        for (int iResponse = 0; iResponse < Response.Count; iResponse++)
        {
            if (CountRows % 2 >= 1)
            {
                //enableordisable = "";
                _sBackground = "bgcolor='#ECF0F1'";
            }
            else
            {
                // enableordisable = "disabled";
                _sBackground = "";
            }
            string   worker_status        = Response[iResponse].SelectSingleNode("CANDIDATE_APPROVE").InnerText;
            DateTime candidate_start_date = DateTime.Parse(Response[iResponse].SelectSingleNode("STARTDATE").InnerText);
            DateTime job_start_date       = DateTime.Parse(Response[iResponse].SelectSingleNode("CONTRACT_START_DATE").InnerText);
            DateTime thisday = DateTime.Today;
            if (worker_status == "1" && (candidate_start_date <= thisday))
            {
                sTable = sTable + "<tr " + _sBackground + ">";
                sTable = sTable + "<td>" + CountRows + "</td>";
                //sTable = sTable + "<td>" + Response[iResponse].SelectSingleNode("ACTIVE").InnerText + " </TD>";
                sTable = sTable + "<td><a href='Client_View_Worker_detail.aspx?wopen=Y&p=VW&empid=" + Response[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "'>" + Response[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "</a> </td> ";
                sTable = sTable + "<td>" + func.FixString(Response[iResponse].SelectSingleNode("FIRSTNAME").InnerText + " " + Response[iResponse].SelectSingleNode("LASTNAME").InnerText) + "</td> ";
                sTable = sTable + "<td>" + func.FixString(Response[iResponse].SelectSingleNode("JOB_TITLE").InnerText) + " </td> ";
                sTable = sTable + "<td>" + func.FixString(Response[iResponse].SelectSingleNode("LOCATION").InnerText) + " </td> ";
                sTable = sTable + "<td>" + DateTime.Parse(Response[iResponse].SelectSingleNode("STARTDATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";
                sTable = sTable + "<td>" + DateTime.Parse(Response[iResponse].SelectSingleNode("ENDDATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";

                sTable = sTable + "</tr>";
                CountRows++;
            }
        }
        sTable = sTable + "</tbody>";
        getWorkers.Dispose();
        lblTableData.Text = sTable;
    }
    private void ViewworkerInTable()
    {
        string sTable = "<tbody>";

        API.Service getWorkers = new API.Service();
        // API.Service getWorkers = new API.Service();
        XmlDocument dom1 = new XmlDocument();

        dom1.LoadXml("<XML>" + getWorkers.get_worker(Session["Email"].ToString(), Session["P@ss"].ToString(), Session["VendorID"].ToString(), Session["ClientID"].ToString()).InnerXml + "</XML>");
        XmlNodeList Response = dom1.SelectNodes("XML/RESPONSE/EMPLOYEE_NAME_ID");


        int CountRows = 1;

        sTable = "";
        string _sBackground = "";

        for (int iResponse = 0; iResponse < Response.Count; iResponse++)
        {
            if (iResponse % 2 >= 1)
            {
                //enableordisable = "";
                _sBackground = "bgcolor='#ECF0F1'";
            }
            else
            {
                // enableordisable = "disabled";
                _sBackground = "";
            }


            sTable = sTable + "<tr " + _sBackground + ">";
            sTable = sTable + "<td>" + CountRows + "</td>";
            //sTable = sTable + "<td>" + Response[iResponse].SelectSingleNode("ACTIVE").InnerText + " </TD>";
            sTable = sTable + "<td><a href='Client_View_Worker_detail.aspx?wopen=Y&p=VW&empid=" + Response[iResponse].SelectSingleNode("EMPLOYEE_FULL_ID").InnerText + "'>" + Response[iResponse].SelectSingleNode("EMPLOYEE_FULL_ID").InnerText + "</a> </td> ";
            sTable = sTable + "<td>" + func.FixString(Response[iResponse].SelectSingleNode("FIRSTNAME").InnerText + " " + Response[iResponse].SelectSingleNode("LASTNAME").InnerText) + "</td> ";
            sTable = sTable + "<td>" + func.FixString(Response[iResponse].SelectSingleNode("JOB_TITLE").InnerText) + " </td> ";
            sTable = sTable + "<td>" + func.FixString(Response[iResponse].SelectSingleNode("LOCATION").InnerText) + " </td> ";
            sTable = sTable + "<td>" + DateTime.Parse(Response[iResponse].SelectSingleNode("START_DATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";
            sTable = sTable + "<td>" + DateTime.Parse(Response[iResponse].SelectSingleNode("END_DATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";

            sTable = sTable + "</tr>";
            CountRows++;
        }
        sTable = sTable + "</tbody>";
        getWorkers.Dispose();
        lblTableData.Text = sTable;
    }
示例#14
0
    private void Loadstate()
    {
        DataTable dt = new DataTable();

        API.Service web  = new API.Service();
        XmlDocument xDoc = new XmlDocument();

        xDoc.LoadXml("<XML>" + web.get_state(Session["Email"].ToString(), Session["P@ss"].ToString(), "").InnerXml + "</XML>");
        XmlNodeList xResponse = xDoc.SelectNodes("XML/RESPONSE/STATE_NO ");

        dt.Columns.Add("STATE_CODE", typeof(string));
        dt.Columns.Add("STATE_ID", typeof(string));

        string sVar = "";
        string sUS  = "";

        foreach (XmlNode node in xResponse)
        {
            DataRow dr = dt.NewRow();


            if (node["COUNTRY_ID"].InnerText == "2")
            {
                sVar = "United States";
            }

            if (node["COUNTRY_ID"].InnerText == "1")
            {
                sVar = "Canada";
            }


            dr["STATE_CODE"] = node["STATE_NAME"].InnerText + " / " + sVar;
            dr["STATE_ID"]   = node["STATE_ID"].InnerText;
            dt.Rows.Add(dr);
        }
        ddlprivince.DataSource     = dt;
        ddlprivince.DataTextField  = "STATE_CODE";
        ddlprivince.DataValueField = "STATE_CODE";
        ddlprivince.DataBind();
        ddlprivince.Items.Insert(0, new ListItem("--Select one--", "0"));
    }
示例#15
0
    // protected void Button1_Click1(object sender, EventArgs e)


    protected void Button2_Click(object sender, EventArgs e)
    {
        if (txtfirst.Text == "" || txtsecond.Text == "" || txtemail.Text == "")
        {
            Label4.Text      = "*Fields can not be empty";
            Label4.ForeColor = System.Drawing.Color.Red;
            Label4.Focus();
        }


        else
        {
            XmlDocument xmldoc  = new XmlDocument();
            API.Service updateP = new API.Service();
            // API.Service updateP = new API.Service();
            xmldoc.LoadXml("<XML>" + updateP.update_Basic_Profile(Session["Email"].ToString(), Session["P@ss"].ToString(), txtfirst.Text, txtsecond.Text, txtemail.Text, Session["UserID"].ToString()).InnerXml + "</XML>");
            Session["Email"] = "";
            Session["Email"] = txtemail.Text;
            Response.Redirect("V_settings.aspx");
        }
    }
示例#16
0
    //private void Loadcountry()
    //{
    //    DataTable dt = new DataTable();
    //    API.Service web = new API.Service();
    //    XmlDocument xDoc = new XmlDocument();
    //    xDoc.LoadXml("<XML>" + web.get_country(Session["Email"].ToString(), Session["P@ss"].ToString(), "").InnerXml + "</XML>");
    //    XmlNodeList xResponse = xDoc.SelectNodes("XML/RESPONSE/COUNTRY_NO ");
    //    dt.Columns.Add("COUNTRY_NAME", typeof(string));
    //    dt.Columns.Add("COUNTRY_ID", typeof(string));
    //    foreach (XmlNode node in xResponse)
    //    {
    //        DataRow dr = dt.NewRow();
    //        dr["COUNTRY_NAME"] = node["COUNTRY_NAME"].InnerText;
    //        dr["COUNTRY_ID"] = node["COUNTRY_ID"].InnerText;
    //        dt.Rows.Add(dr);
    //    }
    //    ddlcountry.DataSource = dt;
    //    ddlcountry.DataTextField = "COUNTRY_NAME";
    //    ddlcountry.DataValueField = "COUNTRY_NAME";
    //    ddlcountry.DataBind();
    //}
    private void Loadjobs()
    {
        DataTable dt = new DataTable();

        API.Service web  = new API.Service();
        XmlDocument xDoc = new XmlDocument();

        xDoc.LoadXml("<XML>" + web.get_all_available_job_for_particuler_vendor(Session["Email"].ToString(), Session["P@ss"].ToString(), Session["VendorID"].ToString()).InnerXml + "</XML>");
        XmlNodeList xResponse = xDoc.SelectNodes("XML/RESPONSE/JOB_NO");

        dt.Columns.Add("JOB_TITLE-JOB_ID", typeof(string));
        dt.Columns.Add("JOB_ID", typeof(string));
        foreach (XmlNode node in xResponse)
        {
            DataRow dr = dt.NewRow();
            dr["JOB_TITLE-JOB_ID"] = node["JOB_TITLE-JOB_ID"].InnerText;
            dr["JOB_ID"]           = node["JOB_ID"].InnerText;
            dt.Rows.Add(dr);
        }
        ddljobs.DataSource     = dt;
        ddljobs.DataTextField  = "JOB_TITLE-JOB_ID";
        ddljobs.DataValueField = "JOB_ID";
        ddljobs.DataBind();
    }
示例#17
0
    protected void btnsend_Click(object sender, EventArgs e)
    {
        ///get job_id using employyee_id

        string empid_url  = Request["empid"];
        int    empid_url1 = Int32.Parse(Request["empid"].Substring(Request["empid"].Length - 6));

        // API.Service setfeedback = new API.Service();
        API.Service setfeedback = new API.Service();
        XmlDocument dom1        = new XmlDocument();

        dom1.LoadXml("<XML>" + setfeedback.get_employees(Session["Email"].ToString(), Session["P@ss"].ToString(), empid_url1.ToString(), Session["VendorID"].ToString(), Session["ClientID"].ToString(), "", "", "1", "").InnerXml + "</XML>");
        XmlNodeList Response = dom1.SelectNodes("XML/RESPONSE/EMPLOYEE_NAME_ID");

        // lblname.Text = func.FixString(Response[iResponse].SelectSingleNode("FIRSTNAME").InnerText) + " " + func.FixString(Response[iResponse].SelectSingleNode("LASTNAME").InnerText);
        jobid_feed = Response[iResponse].SelectSingleNode("JOB_ID").InnerText;



        ///get feedback id  using employyee_id,jobid,client id,vendor id

        dom1.LoadXml("<XML>" + setfeedback.get_v_feedback(Session["Email"].ToString(), Session["P@ss"].ToString(), "", empid_url1.ToString(), "", Session["VendorID"].ToString(), Session["ClientID"].ToString()).InnerXml + "</XML>");
        XmlNodeList Response5   = dom1.SelectNodes("XML/RESPONSE/FEEDBACK");
        string      feedback_id = Response5[iResponse].SelectSingleNode("FEEEDBACK_ID").InnerText;


        /// insert comment in to table

        dom1.LoadXml("<XML>" + setfeedback.insert_c_comments_feedback(Session["Email"].ToString(), Session["P@ss"].ToString(), jobid_feed, txtfeedcomment.Text, empid_url1.ToString(), Session["VendorID"].ToString(), Session["ClientID"].ToString(), feedback_id).InnerXml + "</XML>");
        XmlNodeList Response2 = dom1.SelectNodes("XML/RESPONSE");

        if (Response2.Item(0).SelectSingleNode("STATUS").InnerText == "1")
        {
            HttpContext.Current.Response.Redirect("C_View_Candidate.aspx?wopen=Y&p=VW&empid=" + empid_url);
        }
    }
示例#18
0
    private void LoadJobStatus()
    {
        DataTable dt = new DataTable();

        API.Service web  = new API.Service();
        XmlDocument xDoc = new XmlDocument();

        xDoc.LoadXml("<XML>" + web.get_Job_Status("", Session["Email"].ToString(), Session["P@ss"].ToString()).InnerXml + "</XML>");
        XmlNodeList xResponse = xDoc.SelectNodes("XML/RESPONSE/JOB_STATUS");

        dt.Columns.Add("JOB_STATUS", typeof(string));
        dt.Columns.Add("JOB_STATUS_ID", typeof(string));
        foreach (XmlNode node in xResponse)
        {
            DataRow dr = dt.NewRow();
            dr["JOB_STATUS"]    = node["JOB_STATUS"].InnerText;
            dr["JOB_STATUS_ID"] = node["JOB_STATUS_ID"].InnerText;
            dt.Rows.Add(dr);
        }
        ddljobStatus.DataSource     = dt;
        ddljobStatus.DataTextField  = "JOB_STATUS";
        ddljobStatus.DataValueField = "JOB_STATUS_ID";
        ddljobStatus.DataBind();
    }
示例#19
0
    private void Loadjoblocation()
    {
        DataTable dt = new DataTable();

        API.Service web  = new API.Service();
        XmlDocument xDoc = new XmlDocument();

        xDoc.LoadXml("<XML>" + web.get_job_location("", Session["ClientID"].ToString(), "", "", "", "", "", "", Session["Email"].ToString(), Session["P@ss"].ToString()).InnerXml + "</XML>");
        XmlNodeList xResponse = xDoc.SelectNodes("XML/RESPONSE/JOB_LOCATIONS");

        dt.Columns.Add("ADDRESS1", typeof(string));
        dt.Columns.Add("JOB_LOCATION_ID", typeof(string));
        foreach (XmlNode node in xResponse)
        {
            DataRow dr = dt.NewRow();
            dr["ADDRESS1"]        = node["ADDRESS1"].InnerText;
            dr["JOB_LOCATION_ID"] = node["JOB_LOCATION_ID"].InnerText;
            dt.Rows.Add(dr);
        }
        ddllocation.DataSource     = dt;
        ddllocation.DataTextField  = "ADDRESS1";
        ddllocation.DataValueField = "JOB_LOCATION_ID";
        ddllocation.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string sDates                  = "";
        string sDateDetails            = "";
        string sTable                  = "";
        string disable                 = "";
        string rejected                = "";
        string more_info               = "";
        string cand_approve            = "";
        string interview_date          = "";
        string interview_confirm1      = "";
        string interview_time          = "";
        string schedule                = "";
        string job_end_date            = "";
        string emp_end_date            = "";
        string job_id                  = "";
        string more_info_reply         = "";
        string message_time            = "";
        string vendor_reject_candidate = "";
        string interview_rescheduled;

        conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString);


        //show timesheets needed to be approved
        try
        {
            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();


                //string sqlGetJobCountNoAction = " select distinct  ed.create_date " +
                //                                " from ovms_employee_details ed, ovms_employees em, ovms_employee_actions ea " +
                //                              " where ed.employee_id = em.employee_id " +
                //                              " and ed.create_date <= '" + sDate + "' " +
                //                              " and ed.active = 1 " +
                //                              " and em.active = 1 " +
                //                              " and ea.client_id = em.client_id " +
                //                              " and em.client_id = " + Session["ClientID"].ToString() + " " +
                //                              " and em.employee_id not in (select employee_id from ovms_employee_actions as ea ) " +
                //                              " and ed.first_name <> '' " +
                //                              " order by ed.create_date asc";
                //SqlCommand cmdGetNoAction = new SqlCommand(sqlGetJobCountNoAction, conn);
                //SqlDataReader rsGetNoAction = cmdGetNoAction.ExecuteReader();

                //string sPopulateDrop = "";
                //if (rsGetNoAction.HasRows == true)
                //{

                //    sDates = "";

                //    while (rsGetNoAction.Read())
                //    {
                //        sDates = sDates + "<optgroup label='" + rsGetNoAction["create_date"].ToString().Replace("12:00:00 AM", "") + "'>here";

                string sqlGetActionDetailsNoFeedback = " select distinct concat('W', clt.client_alias, '00', right('0000' + convert(varchar(4), em.employee_id), 4)) employee_id, ed.create_date , " +
                                                       " (select job_title from ovms_jobs where job_id = (select job_id from ovms_employees where employee_id = ed.employee_id)) as job_Title, " +
                                                       " dbo.CamelCase(ed.First_Name) as First_Name, " +
                                                       " dbo.CamelCase(ed.Last_Name) as Last_Name, " +
                                                       " em.vendor_id, em.client_Id, em.job_id,j.contract_start_date,j.contract_end_date,ed.end_date,ed.start_date, " +
                                                       " em.user_id from ovms_employee_details ed " +
                                                       " inner join ovms_candidate_feedback as f on f.emplyee_id = ed.employee_id, " +
                                                       " ovms_jobs as j  , " +
                                                       " ovms_employees em, ovms_clients as clt, ovms_employee_actions eact " +
                                                       " where ed.employee_id = em.employee_id " +
                                                       " and em.client_id = clt.client_id and ed.active = 1 " +
                                                       " and em.active = 1 " +
                                                       " and j.job_id = em.job_id " +
                                                       " and eact.client_id = em.client_id " +
                                                       " and em.client_id = " + Session["ClientID"].ToString() + " " +
                                                       " and em.employee_id not in (select employee_id from ovms_employee_actions as eact ) " +
                                                       " and ed.first_name <> ''";

                SqlCommand    cmdActionDetails     = new SqlCommand(sqlGetActionDetailsNoFeedback, conn);
                SqlDataReader rsGetNoActionDetails = cmdActionDetails.ExecuteReader();
                sDateDetails = "";



                sTable = sTable + "<tbody>";
                if (rsGetNoActionDetails.HasRows == true)
                {
                    while (rsGetNoActionDetails.Read())
                    {
                        sTable = sTable + "<tr>";
                        sTable = sTable + "<td><a target='_blank'  href='Client_View_Worker_detail.aspx?wopen=Y&p=VW&empid=" + rsGetNoActionDetails["employee_id"].ToString() + "'>" + rsGetNoActionDetails["employee_id"].ToString() + " </a></td> ";
                        sTable = sTable + "<td>" + func.FixString(rsGetNoActionDetails["First_Name"].ToString()) + " " + func.FixString(rsGetNoActionDetails["Last_Name"].ToString()) + "</td> ";
                        sTable = sTable + "<td>" + rsGetNoActionDetails["job_Title"].ToString() + " </td> ";
                        string      employee2   = rsGetNoActionDetails["employee_id"].ToString();
                        string      employeeID  = (employee2.Substring(employee2.Length - 6));
                        API.Service getMSGcount = new API.Service();
                        XmlDocument doc1        = new XmlDocument();
                        doc1.LoadXml("<XML>" + getMSGcount.get_message_count_interview_client(Session["Email"].ToString(), Session["P@ss"].ToString(), employeeID).InnerXml + "</XML>");
                        XmlNodeList Response07 = doc1.SelectNodes("XML/RESPONSE/MESSAGE ");

                        if (Response07.Count != 0)

                        {
                            sTable = sTable + "<td><font color='red'><blink><i class='fa fa-fw fa-envelope-o'></i></blink></font><br><a target='_blank' href='C_Dashboard.aspx?wopen=Y&p=VW&done_dash=" + rsGetNoActionDetails["employee_id"].ToString() + "&job_id=" + rsGetNoActionDetails["job_id"].ToString() + "&job_end_date=" + rsGetNoActionDetails["contract_end_date"].ToString() + "&emp_enddate=" + rsGetNoActionDetails["end_date"].ToString() + "'class='btn btn-success btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='Request for an Interview or Approve candidate'><i class='fa fa-calendar fa-fw'></i></a> " +
                                     "<a target='_blank' href='C_Dashboard.aspx?wopen=Y&p=VW&Reject_dash=" + rsGetNoActionDetails["employee_id"].ToString() + "&job_id=" + rsGetNoActionDetails["job_id"].ToString() + "&job_end_date=" + rsGetNoActionDetails["contract_end_date"].ToString() + "&emp_enddate=" + rsGetNoActionDetails["end_date"].ToString() + "' class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Reject Candidate'><i class='fa fa-times'></i></a> " +
                                     "<a target='_blank' href='C_Dashboard.aspx?wopen=Y&p=VW&emp_id=" + rsGetNoActionDetails["employee_id"].ToString() + "&schedule_int=" + schedule + "&forImsgDash=" + 1 + "'class='btn btn-primary btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='Send Comments To Vendor'><i class='fa fa-comment''></i></a></td>";
                        }
                        else
                        {
                            sTable = sTable + "<td><a target='_blank' href='C_Dashboard.aspx?wopen=Y&p=VW&done_dash=" + rsGetNoActionDetails["employee_id"].ToString() + "&job_id=" + rsGetNoActionDetails["job_id"].ToString() + "&job_end_date=" + rsGetNoActionDetails["contract_end_date"].ToString() + "&emp_enddate=" + rsGetNoActionDetails["end_date"].ToString() + "'class='btn btn-success btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='Request for an Interview or Approve candidate'><i class='fa fa-calendar fa-fw'></i></a> " +
                                     "<a target='_blank' href='C_Dashboard.aspx?wopen=Y&p=VW&Reject_dash=" + rsGetNoActionDetails["employee_id"].ToString() + "&job_id=" + rsGetNoActionDetails["job_id"].ToString() + "&job_end_date=" + rsGetNoActionDetails["contract_end_date"].ToString() + "&emp_enddate=" + rsGetNoActionDetails["end_date"].ToString() + "' class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Reject Candidate'><i class='fa fa-times'></i></a> " +
                                     "<a target='_blank' href='C_Dashboard.aspx?wopen=Y&p=VW&emp_id=" + rsGetNoActionDetails["employee_id"].ToString() + "&schedule_int=" + schedule + "&forImsgDash=" + 1 + "'class='btn btn-primary btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='Send Comments To Vendor'><i class='fa fa-comment''></i></a></td>";
                        }

                        sTable = sTable + "</tr>";
                    }
                    //close
                    rsGetNoActionDetails.Close();
                    cmdActionDetails.Dispose();
                }


                else
                {
                    sTable = sTable + "<tr>";
                    sTable = sTable + "<td colspan=3>No Candidate at this time</td>";
                    sTable = sTable + "</tr>";
                }

                sTable = sTable + "</tbody>";

                lblTableData.Text = sTable;
            }
        }
        catch (Exception ex)
        {
            //
        }
        finally
        {
            if (conn.State == System.Data.ConnectionState.Open)
            {
                conn.Close();
            }
        }
    }
示例#21
0
    protected void btnaddjob_Click(object sender, EventArgs e)
    {
        // localhost.Service web = new localhost.Service();
        API.Service web    = new API.Service();
        XmlDocument dom1   = new XmlDocument();
        string      UserID = "";


        int sCheckedUrgent = 0;

        if (checkurgent.Checked == true)
        {
            sCheckedUrgent = 1;
        }
        DateTime todayDate = DateTime.Today;

        // txtstd_pay_rate_from.Value = (Convert.ToInt32(txtdbl_pay_rate_from.Value) * (TextBox1.Text));

        UserID = Session["UserID"].ToString();

        if (newdiv.Visible == true && markupdiv.Visible == false && permentdiv.Visible == false && divposition.Visible == true && divjobstart.Visible == false)
        {
            dom1.LoadXml("<XML>" + web.set_jobs(ddljobStatus.Value, txtjobtitle.Value, ddldepartment.Value,
                                                Session["ClientID"].ToString(), ddlpositiontype.Value, txtnumberofopning.Value, ddlvendor.Value,
                                                ddllocation.Value, txttraveltime.Value, txthoursperday.Value, txtroles_and_responsibility.Text.Replace("'", "''"),
                                                txthiremanagername.Value, txtcoordinator.Value, txtcontstart.Value.ToString(), txtendstart.Value.ToString(),
                                                txtmaxsub.Value, ddlreasonforopen.SelectedValue, ddlinterviw.SelectedValue,
                                                sCheckedUrgent.ToString(), Session["Email"].ToString(), Session["P@ss"].ToString(),
                                                "0", ddlmove.SelectedValue, "0", txtst_bill_rate_from.Value, "0", "0",
                                                "0", "0", "0", UserID, "0", "0", "0", "0").InnerXml + "</XML>");
        }
        else if (newdiv.Visible == false && markupdiv.Visible == true && permentdiv.Visible == false && divposition.Visible == true && divjobstart.Visible == false)
        {
            dom1.LoadXml("<XML>" + web.set_jobs(ddljobStatus.Value, Server.HtmlEncode(txtjobtitle.Value), ddldepartment.Value,
                                                Session["ClientID"].ToString(), ddlpositiontype.Value, txtnumberofopning.Value, ddlvendor.Value,

                                                ddllocation.Value, txttraveltime.Value,
                                                txthoursperday.Value, Server.HtmlEncode(txtroles_and_responsibility.Text.Replace("'", "''")), txthiremanagername.Value, txtcoordinator.Value, txtcontstart.Value.ToString(), txtendstart.Value.ToString(),
                                                txtmaxsub.Value, ddlreasonforopen.SelectedValue, ddlinterviw.SelectedValue,
                                                sCheckedUrgent.ToString(), Session["Email"].ToString(), Session["P@ss"].ToString(),
                                                txtstd_pay_rate_from.Value, ddlmove.SelectedValue, txtmarkup.Value,
                                                "0", "0", "0", txtvendor_pay.Value, txtvendorot_pay.Value, txtvendordbl_pay.Value, UserID, "0", "0", "0", "0").InnerXml + "</XML>");
        }
        else
        {
            dom1.LoadXml("<XML>" + web.set_jobs(ddljobStatus.Value, txtjobtitle.Value, ddldepartment.Value,
                                                Session["ClientID"].ToString(), "3", txtnumberofopning.Value, ddlvendor.Value,
                                                ddllocation.Value, txttraveltime.Value, txthoursperday.Value, txtroles_and_responsibility.Text.Replace("'", "''"),
                                                txthiremanagername.Value, txtcoordinator.Value, txtjobstart.Value.ToString(), "",
                                                txtmaxsub.Value, ddlreasonforopen.SelectedValue, ddlinterviw.SelectedValue,
                                                sCheckedUrgent.ToString(), Session["Email"].ToString(), Session["P@ss"].ToString(),
                                                "0", ddlmove.SelectedValue, "0", "0", "0", "0",
                                                "0", "0", "0", UserID, txtbouns.Value, txtbenifits.Text.Replace("'", "''"), txtbasesallary.Value, "0").InnerXml + "</XML>");
        }
        XmlNodeList Response    = dom1.SelectNodes("XML/RESPONSE");
        string      job         = Response.Item(0).SelectSingleNode("JOB_ID").InnerText;
        string      jobdetailid = Response.Item(0).SelectSingleNode("JOB_DETAIL_ID").InnerText;

        Session["jobdeailID"] = jobdetailid;
        dom1.LoadXml("<XML>" + web.insert_job_comments(Session["Email"].ToString(), Session["P@ss"].ToString(), txtcomment.Text, Convert.ToInt32(job), todayDate, Convert.ToInt32(UserID)).InnerXml + "</XML>");
        XmlNodeList Response1 = dom1.SelectNodes("XML/RESPONSE");

        if (txtQuestion1 != null)
        {
            dom1.LoadXml("<XML>" + web.Insert_Jobquestions_ratings(Session["Email"].ToString(), Session["P@ss"].ToString(), ddlvendor.Value, Session["ClientID"].ToString(), txtQuestion1.Text, txtRating1.Text, txtQuestion2.Text, txtRating2.Text, txtquestion3.Text, txtRating3.Text, txtquestion4.Text, txtRating4.Text, txtquestion5.Text, txtRating5.Text, UserID, job).InnerXml + "</XML>");

            // dom1.LoadXml("<XML>" + web.Insert_Job_Questions(Session["Email"].ToString(), Session["P@ss"].ToString(), "0",   ddlvendor.DataValueField , Session["ClientID"].ToString(), txtQuestion1.Text, txtRating1.Text, txtQuestion2.Text, txtRating2.Text, txtquestion3.Text, txtRating3.Text, txtquestion4.Text, txtRating4.Text, txtquestion5.Text, txtRating5.Text, UserID, job).InnerXml + "</XML>");
            XmlNodeList Response2 = dom1.SelectNodes("XML/RESPONSE");
            if (Response2.Item(0).SelectSingleNode("DATA").InnerText != "")
            {
                lblTableData.Text = "New Job Added succcessfully";
            }
        }
        API.Service jobInfo = new API.Service();
        XmlDocument xmldoc  = new XmlDocument();

        xmldoc.LoadXml("<XML>" + jobInfo.preview_job(job, Session["Email"].ToString(), Session["P@ss"].ToString(), Session["VendorID"].ToString(), Session["UserID"].ToString(), Session["ClientID"].ToString()).InnerXml + "</XML>");
        XmlNodeList Response7  = xmldoc.SelectNodes("XML/RESPONSE/JOBS ");
        string      jobtitle   = func.FixString(Server.HtmlDecode(Response7[iResponse].SelectSingleNode("JOB_TITLE").InnerText));
        string      location   = Response7[iResponse].SelectSingleNode("JOB_LOCATION").InnerText;
        string      noofopning = Response7[iResponse].SelectSingleNode("NO_OF_OPENINGS").InnerText;
        string      desc       = Server.HtmlDecode(Response7[iResponse].SelectSingleNode("JOB_DESC").InnerText);

        semail.sendEmail("*****@*****.**", "New job added by client " + Session["clientname"].ToString(), "<br>Client ID :" + Session["ClientID"].ToString() +
                         "<br>Client Name :" + Session["clientname"].ToString() +
                         "<br>jobId :" + job +
                         "<br>job Title :" + jobtitle +
                         "<br>job Description :" + desc +
                         // "<br>location :" + location +
                         "<br>No of Openings :" + noofopning +
                         "<br><br>******" +
                         "<br>This notification was sent by FlentisPRO.If you have any questions regarding this notice," +
                         "<br>please contact the SAP Fieldglass Helpdesk at:" +
                         "<br>mailto:[email protected]" +
                         "<br>By Phone:" +
                         "<br>US(toll free) 1 800 123 1234" +
                         "<br>Please do not respond to this email, this is an automatic email message and this mailbox is not being monitored.", "", "");

        Session["clientname"] = "";



        dom1.LoadXml("<XML>" + web.get_job_alias(Session["Email"].ToString(), Session["P@ss"].ToString(), job.ToString()).InnerXml + "</XML>");

        XmlNodeList Response3 = dom1.SelectNodes("XML/RESPONSE");
        string      jobalias  = Response3.Item(0).SelectSingleNode("JOB_ALIAS").InnerText;
        string      end       = Response3.Item(0).SelectSingleNode("JOB_ID").InnerText;

        HttpContext.Current.Response.Redirect("Preview_job.aspx?jobId=" + jobalias);
        // Response.Redirect(");

        /* ******* SMS Notification ******* */
        SqlConnection conn;
        string        readsms;

        conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString);
        try
        {
            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();
                string     smsquery = "select vendors from ovms_jobs where job_id = " + job;
                SqlCommand smscmd   = new SqlCommand(smsquery, conn);
                readsms = smscmd.ExecuteReader().ToString();

                string message             = jobtitle + "\n" + desc;
                ConvertPdf.converter files = new ConvertPdf.converter();
                files.client_smsNotification(readsms, message, Session["ClientID"].ToString(), "newjob_notify");

                smscmd.Dispose();
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
        finally
        {
            conn.Close();
        }
    }
示例#22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (Request["NM"] != null)
        //{
        //    if (Request["NM"] == "Y")
        //    {
        //        Response.Redirect("Add_Worker.aspx?wopen=Y&p=AW&jobID=" + Request.QueryString["jobID"].ToString() + "&SN=T");
        //    }
        //}


        if (Session["Email"] == null)
        {
            //logout
            Session.Abandon();
            Response.Redirect("Login.aspx?m=You+have+logged+out");
            Response.End();
        }
        btnpreview.Enabled = true;
        //check if employee is a dup
        if ((Request.Form["ctl00$MainContent$txtemail"] != null) && (Request.Form["ctl00$MainContent$txtemail"] != ""))
        {
            if (CheckCandidateDup(Request.Form["ctl00$MainContent$txtemail"]) == "YES")
            {
                lblDuplicate.Text  = "This candidate already exists, please submit someone else";
                btnpreview.Enabled = false;
            }
            else
            {
                lblDuplicate.Text = "";
            }
        }

        if (Request.QueryString["jobID"] == null)
        {
            string a = "";
        }
        else
        {
            API.Service web1 = new API.Service();
            //  API.Service web1 = new API.Service();
            XmlDocument dom2  = new XmlDocument();
            int         jobID = 0;
            if (Request.QueryString["jobID"] != "")
            {
                jobID = Int32.Parse(Request.QueryString["jobID"].Substring(Request.QueryString["jobID"].Length - 5));
            }
            //  string strID = Request.QueryString["jobID"];

            dom2.LoadXml("<XML>" + web1.get_jobrating(Session["Email"].ToString(), Session["P@ss"].ToString(), jobID.ToString()).InnerXml + "</XML>");
            XmlNodeList Response3 = dom2.SelectNodes("XML/RESPONSE/QUESTIONS_NO ");
            string      que1      = "";
            string      que2      = "";
            string      que3      = "";
            string      que4      = "";
            string      que5      = "";
            string      rating1   = "";
            string      rating2   = "";
            string      rating3   = "";
            string      rating4   = "";
            string      rating5   = "";


            try
            {
                //que1 = Server.HtmlDecode(Response3[intCount1].SelectSingleNode("QUESTION1").InnerText);
                que1    = Server.HtmlDecode(Response3[intCount1].SelectSingleNode("QUESTION1").InnerText);
                que2    = Response3[intCount1].SelectSingleNode("QUESTION2").InnerText;
                que3    = Response3[intCount1].SelectSingleNode("QUESTION3").InnerText;
                que4    = Response3[intCount1].SelectSingleNode("QUESTION4").InnerText;
                que5    = Response3[intCount1].SelectSingleNode("QUESTION5").InnerText;
                rating1 = Response3[intCount1].SelectSingleNode("RATING1").InnerText;
                rating2 = Response3[intCount1].SelectSingleNode("RATING2").InnerText;
                rating3 = Response3[intCount1].SelectSingleNode("RATING3").InnerText;
                rating4 = Response3[intCount1].SelectSingleNode("RATING4").InnerText;
                rating5 = Response3[intCount1].SelectSingleNode("RATING5").InnerText;
            }
            catch (Exception ex)
            {
                //nothing
                //que1 = "";
            }
            if (que1 == "")
            {
                divstar.Visible = false;
            }
            else
            {
                divstar.Visible = true;
            }


            lblque1.Text    = que1;
            labque2.Text    = que2;
            lblque3.Text    = que3;
            lblque4.Text    = que4;
            lblque5.Text    = que5;
            txtRating1.Text = rating1;
            txtRating2.Text = rating2;
            txtRating3.Text = rating3;
            txtRating4.Text = rating4;
            txtRating5.Text = rating5;

            // API.Service web3 = new API.Service();
            API.Service web3 = new API.Service();
            XmlDocument dom3 = new XmlDocument();
            dom3.LoadXml("<XML>" + web3.get_Jobs(jobID.ToString(), Session["Email"].ToString(), Session["P@ss"].ToString(), Session["VendorID"].ToString(), Session["UserID"].ToString(), Session["ClientID"].ToString()).InnerXml + "</XML>");
            XmlNodeList Response8 = dom3.SelectNodes("XML/RESPONSE/JOBS ");

            lblnoofopning.Text = Response8[iResponse].SelectSingleNode("NO_OF_OPENINGS").InnerText;
            lblstartdate.Text  = DateTime.Parse(Response8[iResponse].SelectSingleNode("CONTRACT_START_DATE").InnerText).ToString("dd MMM, yyyy");

            lblenddate.Text      = DateTime.Parse(Response8[iResponse].SelectSingleNode("CONTRACT_END_DATE").InnerText).ToString("dd MMM, yyyy");
            lblUrgent.Text       = Response8[iResponse].SelectSingleNode("URGENT").InnerText;
            lbljobtitle.Text     = Server.HtmlDecode(Response8[iResponse].SelectSingleNode("JOB_TITLE").InnerText);
            lbllocation2.Text    = Response8[iResponse].SelectSingleNode("JOB_LOCATION").InnerText;
            lblbill.Text         = Response8[iResponse].SelectSingleNode("STD_BILL_RATE").InnerText;
            lbladdress2.Text     = Response8[iResponse].SelectSingleNode("ADDRESS1").InnerText;
            lblpay2.Text         = Response8[iResponse].SelectSingleNode("STD_PAY_RATE").InnerText;
            lbllocation.Text     = Response8[iResponse].SelectSingleNode("JOB_LOCATION").InnerText;
            lbladdres.Text       = Response8[iResponse].SelectSingleNode("ADDRESS1").InnerText;
            lblsalary.Text       = Response8[iResponse].SelectSingleNode("BASE_SALARY").InnerText;
            lbllocation3.Text    = Response8[iResponse].SelectSingleNode("JOB_LOCATION").InnerText;
            lbladdress3.Text     = Response8[iResponse].SelectSingleNode("ADDRESS1").InnerText;
            lblpositiontype.Text = Response8[iResponse].SelectSingleNode("JOB_POSITION_TYPE").InnerText;;

            if (lblpay2.Text == "" || lblpay2.Text == "0" && (lblbill.Text == "" || lblbill.Text == "0") && (lblsalary.Text != "" || lblsalary.Text != "0"))
            //  if (z == "0" && p != "0" && q == "0")
            {
                y.Visible = false;
                x.Visible = false;
                w.Visible = true;
            }
            else if (lblbill.Text == null || lblbill.Text == "0" && (lblpay2.Text != null || lblpay2.Text != "0") && (lblsalary.Text == "" || lblsalary.Text == "0"))
            // else if (z != "0" && p == "0" && q == "0")
            {
                y.Visible = false;
                x.Visible = true;
                w.Visible = false;
            }
            else
            {
                x.Visible = false;
                y.Visible = true;
                w.Visible = false;
            }
            //string z = Response8[iResponse].SelectSingleNode("STD_PAY_RATE").InnerText;
            //if (z == "0")
            //{
            //    x.Visible = false;
            //    y.Visible = true;
            //    lbllocation2.Text = Response8[iResponse].SelectSingleNode("JOB_LOCATION").InnerText;
            //    lblbill.Text = Response8[iResponse].SelectSingleNode("STD_BILL_RATE").InnerText;
            //    lbladdress2.Text = Response8[iResponse].SelectSingleNode("ADDRESS1").InnerText;
            //}
            //else
            //{
            //    y.Visible = false;
            //    x.Visible = true;
            //    lblpay.Text = Response8[iResponse].SelectSingleNode("VENDER_PAY_RATE").InnerText;
            //    lbllocation.Text = Response8[iResponse].SelectSingleNode("JOB_LOCATION").InnerText;
            //    lbladdres.Text = Response8[iResponse].SelectSingleNode("ADDRESS1").InnerText;
            //}
            if (lblUrgent.Text == "1")
            {
                lblUrgent.Text = "<blink>(Urgent Request)</blink>";
            }
            else
            {
                lblUrgent.Text = "";
            }
        }
        if (Page.IsPostBack)
        {
            if (Request.QueryString["jobID"] == null)
            {
                string v = Request.Form["ctl00$MainContent$ddljobs"];
                Response.Redirect("Add_worker.aspx?wopen=Y&p=AW&jobID=" + v.ToString());
            }

            //         @" <div class=""modal slide-down fade"" id=""modal - select1"">" +
            //     @"  < div class=""modal - dialog"">" +
            //     @"  <div class=""v - cell"" >"+
            //     @"  <div class=""modal - content"" >"+
            //     @"  <div class=""modal - header"" >+
            //     @"  <button type ='button' class='close' data-dismiss='modal'> "+
            //@"  <span aria-hidden=""true"">&times</span><span class=""sr - only"">Close</span></button> "+


            //     @" </div>" +

            //     @"  <div class=""modal - body"">" +
            //     @"    <div class=""panel - body"">" +



            //     @"    <asp:Label ID = ""lblmessege"" class=""media - heading margin - v - 5"" runat=""server""> stars are not matching</asp:Label>" +



            //     @"  </div>" +

            //     @" </div>" +
            //     @"  <div class=""modal - footer"">" +

            //     @" <button type = ""button"" class=""btn btn-default"" data-dismiss=""modal"">Close</button>" +
            //     @" <asp:Button ID = ""btnsbmit"" class=""btn btn-primary"" OnClick=""btnsbmit_Click"" runat=""server"" Text=""Continue"" /> " +
            //     @"</div>" +

            //     @" </div> " +
            //     @" </div> " +
            //     @" </div> " +
            //     @" </div> ";
            // }
        }
        if (!Page.IsPostBack)
        {
            ///Loadcountry();
            Loadstate();
            string v = Request.QueryString["jobID"];
            if (v == null)
            {
                job.Visible = true;
                Loadjobs();
            }
            else
            {
                job.Visible = false;
            }
        }
    }
示例#23
0
    public void setEmployee()
    {
        int jobID = 0;

        if (Request.QueryString["jobID"] != "")
        {
            jobID = Int32.Parse(Request.QueryString["jobID"].Substring(Request.QueryString["jobID"].Length - 5));
        }
        string UserID = "";

        if (FileUpload1.HasFile)
        {
            if (FileUpload1.PostedFile.ContentType == "image/jpeg" || FileUpload1.PostedFile.ContentType == "image/jpg")
            {
                fileExtension = Path.GetExtension(FileUpload1.FileName);
                if (FileUpload1.PostedFile.ContentLength < 100000000)
                {
                    string p = Path.GetFileName(FileUpload1.FileName);
                    //check if vendor exist in folder
                    if (Directory.Exists(Server.MapPath("~/images/profile_picture/" + UserID + "/ ")) == false)
                    {
                        DirectoryInfo di = Directory.CreateDirectory(Server.MapPath("~/images/profile_picture/" + UserID + "/ "));
                    }
                    UniqueDateTime = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    if (fileExtension.ToLower() == ".jpg")
                    {
                        FileUpload1.SaveAs(Server.MapPath("~/images/profile_picture/" + UserID + "/") + (FileUpload1.FileName.Replace(".jpg", "_" + UniqueDateTime + ".jpg")));
                        canPhoto = Server.MapPath("~/images/profile_picture/" + UserID + "/") + (FileUpload1.FileName.Replace(".jpg", "_" + UniqueDateTime + ".jpg"));
                    }
                    //FileUpload1.SaveAs(Server.MapPath("~/images/profile_picture" + FileUpload1.FileName));
                    lblimagestatus.Text = "File Uploaded...";
                    //canPhoto = "~/images/profile_picture" + FileUpload1.FileName;
                }
                else
                {
                    lblimagestatus.Text = "Only JPEG files with max size 1000 KB are accepted..";
                }
            }
        }
        else
        {
            lblimagestatus.Text = "Please select a file to upload...";
        }
        if (fileupresume.HasFile)
        {
            fileExtension = Path.GetExtension(fileupresume.FileName);
            if (fileExtension.ToLower() != ".doc" && fileExtension.ToLower() != ".docx" && fileExtension.ToLower() != ".pdf" && fileExtension.ToLower() != ".rtf")
            {
                lblresumestatus.Text      = "Only Files with .doc or .docx extension are allowed...";
                lblresumestatus.ForeColor = System.Drawing.Color.White;
            }
            else
            {
                int filesize = fileupresume.PostedFile.ContentLength;
                if (filesize > 52428800)
                {
                    lblresumestatus.Text      = "Maximum file size(50 MB) exceeded";
                    lblresumestatus.ForeColor = System.Drawing.Color.White;
                }
                else
                {
                    //check if vendor exist in folder
                    if (Directory.Exists(Server.MapPath("~/Resume/" + Session["VendorID"] + "/")) == false)
                    {
                        DirectoryInfo di = Directory.CreateDirectory(Server.MapPath("~/Resume/" + Session["VendorID"] + "/"));
                    }
                    //check if jobid exists for that vendor for that resume
                    if (Directory.Exists(Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"])) == false)
                    {
                        DirectoryInfo di = Directory.CreateDirectory(Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"]));
                    }
                    UniqueDateTime = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    if (fileExtension.ToLower() == ".doc")
                    {
                        fileupresume.SaveAs(Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"] + "/") + (fileupresume.FileName.Replace(".doc", "_" + UniqueDateTime + ".doc")));
                        canResume = Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"] + "/") + (fileupresume.FileName.Replace(".doc", "_" + UniqueDateTime + ".doc"));
                    }
                    if (fileExtension.ToLower() == ".docx")
                    {
                        fileupresume.SaveAs(Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"] + "/") + (fileupresume.FileName.Replace(".docx", "_" + UniqueDateTime + ".docx")));
                        canResume = Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"] + "/") + (fileupresume.FileName.Replace(".docx", "_" + UniqueDateTime + ".docx"));
                    }
                    if (fileExtension.ToLower() == ".rtf")
                    {
                        fileupresume.SaveAs(Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"] + "/") + (fileupresume.FileName.Replace(".rtf", "_" + UniqueDateTime + ".rtf")));
                        canResume = Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"] + "/") + (fileupresume.FileName.Replace(".rtf", "_" + UniqueDateTime + ".rtf"));
                    }
                    if (fileExtension.ToLower() == ".pdf")
                    {
                        fileupresume.SaveAs(Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"] + "/") + (fileupresume.FileName.Replace(".pdf", "_" + UniqueDateTime + ".pdf")));
                        canResume = Server.MapPath("~/Resume/" + Session["VendorID"] + "/" + Request.QueryString["jobID"] + "/") + (fileupresume.FileName.Replace(".pdf", "_" + UniqueDateTime + ".pdf"));
                    }
                    //fileupresume.SaveAs(Server.MapPath("~/Resume/4/JALS000019/") + fileupresume.FileName);
                    lblresumestatus.Text      = "File uploaded...";
                    lblresumestatus.ForeColor = System.Drawing.Color.White;
                }
            }
        }
        else
        {
            lblresumestatus.Text      = "Please select a file to upload...";
            lblresumestatus.ForeColor = System.Drawing.Color.White;
        }
        API.Service web = new API.Service();
        //API.Service web = new API.Service();
        XmlDocument dom1 = new XmlDocument();

        UserID = Session["UserID"].ToString();
        dom1.LoadXml("<XML>" + web.get_dates(Session["Email"].ToString(), Session["P@ss"].ToString(), jobID.ToString()).InnerXml + "</XML>");

        XmlNodeList Response3 = dom1.SelectNodes("XML/RESPONSE");
        string      strat     = Response3.Item(0).SelectSingleNode("CONTRACT_START_DATE").InnerText;
        string      end       = Response3.Item(0).SelectSingleNode("CONTRACT_END_DATE").InnerText;

        dom1.LoadXml("<XML>" + web.set_employee(Session["Email"].ToString(), Session["P@ss"].ToString(),
                                                txtfistname.Value, txtmiddle.Value, txtlastname.Value, txtemail.Text, txtphone.Value,
                                                txtdateofbirth.Value, txtsuite.Value, txtaddress1.Value, "", txtcity.Value, ddlprivince.SelectedValue,
                                                txtpostal.Value, sCountry, txtcomment.Text, canPhoto, txtavailable.Value, txtskype.Value,
                                                strat, end, jobID, Convert.ToInt32(Session["VendorID"]),
                                                Convert.ToInt32(Session["ClientID"]), txtlicence.Value, txtsinnumber.Value, txtstdpayf.Value).InnerXml + "</XML>");


        //XmlNodeList Response1 = dom1.SelectNodes("XML/RESPONSE");
        //string employeeID = "";
        string employeeID = "";

        try
        {
            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();

                // Session["JobID"] = jobID.ToString();

                //start, end and weeks


                string        sqlGetLastInsertedEmployee = "select max(employee_id) as employee_id from ovms_employees where vendor_id = " + Session["VendorID"].ToString() + " and client_id = " + Session["ClientID"].ToString() + " and job_id = " + jobID + "  and active = 1";
                SqlCommand    cmdLastInsertedEmployee    = new SqlCommand(sqlGetLastInsertedEmployee, conn);
                SqlDataReader readerInsertedEmployee     = cmdLastInsertedEmployee.ExecuteReader();

                if (readerInsertedEmployee.HasRows == true)
                {
                    while (readerInsertedEmployee.Read())
                    {
                        employeeID = readerInsertedEmployee["employee_id"].ToString();
                    }
                }
                //close
                readerInsertedEmployee.Close();
                cmdLastInsertedEmployee.Dispose();
            }
        }
        catch (Exception ex)
        {
            //
        }
        finally
        {
            if (conn.State == System.Data.ConnectionState.Open)
            {
                conn.Close();
            }
        }
        // employeeID = Response1.Item(0).SelectSingleNode("EMPLOYEE_ID").InnerText;

        dom1.LoadXml("<XML>" + web.insert_resume(Session["Email"].ToString(), Session["P@ss"].ToString(), canResume, jobID.ToString(), employeeID, UserID, Session["VendorId"].ToString()).InnerXml + "</XML>");

        XmlNodeList Response2 = dom1.SelectNodes("XML/RESPONSE");

        if (txtemprating1 != null)
        {
            dom1.LoadXml("<XML>" + web.Insert_emp_ratings(Session["Email"].ToString(), Session["P@ss"].ToString(), employeeID, Session["VendorID"].ToString(),
                                                          Session["ClientID"].ToString(), txtemprating1.Text, txtemprating2.Text, txtemprating3.Text, txtemprating4.Text, txtemprating5.Text, Session["UserID"].ToString(), jobID.ToString()).InnerXml + "</XML>");
        }

        XmlNodeList Response6 = dom1.SelectNodes("XML/RESPONSE");

        if (Response6.Item(0).SelectSingleNode("DATA").InnerText != "")
        {
            lblTableData.Text = "New worker Added succcessfully";
        }
        Response.Redirect("Preview_Workers.aspx?empid=" + employeeID + "&jobID=" + Request.QueryString["jobID"]);
    }
示例#24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["C_settingPop"] == "1")
        {
            lbladdress1.Text = Request.QueryString["address1"];
            lbladdress2.Text = Request.QueryString["address2"];
            lblcity.Text     = Request.QueryString["city"];
            lblcopname.Text  = Request.QueryString["compamy_name"];
            lblcountry.Text  = Request.QueryString["country"];
            lblphone.Text    = Request.QueryString["phone"];
            lblemail.Text    = Request.QueryString["email"];
            lblSecEmail.Text = Request.QueryString["secemail"];
            lblfax.Text      = Request.QueryString["fax"];
            lblpostal.Text   = Request.QueryString["postal"];
        }

        if (!Page.IsPostBack)
        {
            XmlDocument xmldoc = new XmlDocument();
            API.Service prof   = new API.Service();
            // API.Service prof = new API.Service();
            xmldoc.LoadXml("<XML>" + prof.get_Profile(Session["Email"].ToString(), Session["P@ss"].ToString(), Session["UserID"].ToString()).InnerXml + "</XML>");
            // xmldoc.LoadXml("<XML>" + prof.get_Profile("[email protected] ", "1234", "9").InnerXml + "</XML>");
            XmlNodeList Response = xmldoc.SelectNodes("XML/RESPONSE/USER_NO");

            txtfirst.Text  = xmldoc.SelectSingleNode("XML/RESPONSE/USER_NO/FIRST_NAME").InnerText;
            txtsecond.Text = xmldoc.SelectSingleNode("XML/RESPONSE/USER_NO/LAST_NAME").InnerText;
            txtemail.Text  = xmldoc.SelectSingleNode("XML/RESPONSE/USER_NO/EMAIL").InnerText;

            // Password1.Value = xmldoc.SelectSingleNode("XML/RESPONSE/USER_NO/PASSWORD").InnerText;

            conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString);

            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();

                // Session["JobID"] = jobID.ToString();

                //start, end and weeks
                string sqlgetvenddetails = " select * from ovms_clients as clt " +
                                           " join ovms_client_details as cltd on clt.client_id = cltd.client_id where clt.client_id =  '" + Session["ClientID"].ToString() + "'";
                SqlCommand    v_details = new SqlCommand(sqlgetvenddetails, conn);
                SqlDataReader reader    = v_details.ExecuteReader();
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        string address1 = "";
                        txtPhone.Text     = reader["client_phoneNumber"].ToString();
                        Txtcompemail.Text = reader["Primary_email"].ToString();
                        address1          = "Suite: " + reader["client_address1"].ToString();
                        // address1 = Server.HtmlDecode(address1 + " Postal Code: " + reader["vendor_postal_code"].ToString());
                        // address1 = address1 + "  Country:" + reader["vendor_country"].ToString();
                        txtComp_name.Text = reader["client_name"].ToString();
                        txtsecEmail.Text  = reader["secondary_email"].ToString();
                        txtSuite.Text     = reader["client_address1"].ToString();
                        txtPostal.Text    = reader["client_postal_code"].ToString();
                        txtcity.Text      = reader["client_city"].ToString();
                        txtcountry.Text   = reader["client_country"].ToString();
                        txtfax.Text       = reader["client_faxNumber"].ToString();
                        txtadrres2.Text   = reader["client_address2"].ToString();
                        // Txtaddres.Text = address1;
                    }
                }
                reader.Close();
                v_details.Dispose();
                conn.Close();
            }

            conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString);
            try
            {
                if (conn.State == System.Data.ConnectionState.Closed)
                {
                    conn.Open();
                    string        querystr = "SELECT TOP 1 client_id FROM ovms_client_smsnotification WHERE client_id = " + Session["ClientID"].ToString();
                    SqlCommand    cmd      = new SqlCommand(querystr, conn);
                    SqlDataReader readers  = cmd.ExecuteReader();
                    if (readers.HasRows == true)
                    {
                        while (readers.Read())
                        {
                            if (readers["client_id"].ToString() == Session["ClientID"].ToString())
                            {
                                string        selectstr = "select * from ovms_client_smsnotification";
                                SqlCommand    cmdsel    = new SqlCommand(selectstr, conn);
                                SqlDataReader reads     = cmdsel.ExecuteReader();
                                if (reads.HasRows == true)
                                {
                                    while (reads.Read())
                                    {
                                        RadioButtonList1.SelectedValue = reads["newjob_notify"].ToString();
                                        RadioButtonList2.SelectedValue = reads["interview_schedule_notify"].ToString();
                                        RadioButtonList3.SelectedValue = reads["interview_reschedule_notify"].ToString();
                                        RadioButtonList4.SelectedValue = reads["candid_approve_notify"].ToString();
                                        RadioButtonList5.SelectedValue = reads["candid_reject_notify"].ToString();
                                        RadioButtonList6.SelectedValue = reads["timesheet_approve_notify"].ToString();
                                        RadioButtonList7.SelectedValue = reads["timesheet_reject_notify"].ToString();
                                    }
                                }
                                reads.Close();
                                cmdsel.Dispose();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                errorDisp.Text = ex.Message;
            }
            finally
            {
                conn.Close();
            }
        }
    }
示例#25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XmlDocument xmldoc = new XmlDocument();

        API.Service MessageList = new API.Service();
        xmldoc.LoadXml("<XML>" + MessageList.get_All_Messages_for_Vendor(Session["Email"].ToString(), Session["P@ss"].ToString(), Session["VendorID"].ToString()).InnerXml + "</XML>");

        XmlNodeList Response       = xmldoc.SelectNodes("XML/RESPONSE/MESSAGE");
        string      Actions1       = "";
        string      IsRead         = "";
        string      subject        = "";
        string      PMO_Name       = "";
        string      Vendor_Name    = "";
        string      Date_PMO       = "";
        string      messid         = "";
        string      _messageID     = "";
        string      msg_id         = "";
        string      PMO_Message    = "";
        string      Date_Vendor    = "";
        string      Vendor_Message = "";
        string      Actions        = "";

        string      subjectcheck = "";
        string      line;
        string      _lineRead      = "";
        string      previous_msgID = Request["id"];
        XmlDocument xmldoc1        = new XmlDocument();

        API.Service MessageList1 = new API.Service();
        for (int iResponse = 0; iResponse < Response.Count; iResponse++)
        {
            // string response = "";
            subject = Response[iResponse].SelectSingleNode("MESSAGE_SUBJECT").InnerText;
            messid  = Response[iResponse].SelectSingleNode("MESSAGE_ID").InnerText;
            xmldoc1.LoadXml("<XML>" + MessageList1.get_Message(Session["Email"].ToString(), Session["P@ss"].ToString(), (messid), 1).InnerXml + "</XML>");
            Actions = Response[iResponse].SelectSingleNode("ACTIONS").InnerText;
            IsRead  = Response[iResponse].SelectSingleNode("IS_READ").InnerText;
            XmlNodeList Response1 = xmldoc1.SelectNodes("XML/RESPONSE/MESSAGE");
            //if (Response[iResponse].SelectSingleNode("IS_READ").InnerText == "1")
            //    {
            //    IsRead = " Read";
            //    }
            //else
            //    {
            //    IsRead = "UnRead";
            //    }
            for (int iResponse2 = 0; iResponse2 < Response1.Count; iResponse2++)
            {
                msg_id         = Response1[iResponse2].SelectSingleNode("MESSAGE_ID").InnerText;
                PMO_Name       = Response[iResponse].SelectSingleNode("PMO_NAME").InnerText;
                Vendor_Name    = Response[iResponse].SelectSingleNode("VENDOR_NAME").InnerText;
                Date_Vendor    = Response1[iResponse2].SelectSingleNode("DATE").InnerText;
                PMO_Message    = Response[iResponse].SelectSingleNode("MESSAGE").InnerText;
                Date_PMO       = Response[iResponse].SelectSingleNode("DATE").InnerText;
                Vendor_Message = Response1[iResponse2].SelectSingleNode("MESSAGE").InnerText;
                Actions1       = Response1[iResponse2].SelectSingleNode("ACTIONS").InnerText;
                IsRead         = Response1[iResponse2].SelectSingleNode("ACTIONS").InnerText;
                System.IO.StreamReader file =
                    new System.IO.StreamReader(Server.MapPath("Messagelist.html"));
                while ((line = file.ReadLine()) != null)
                {
                    _lineRead = _lineRead.Replace("####MESSAGE_ID####", messid);
                    _lineRead = _lineRead.Replace("####SUBJECT####", subject);
                    _lineRead = _lineRead.Replace("####PMONAME####", PMO_Name);
                    _lineRead = _lineRead.Replace("####PMOMESSAGE####", PMO_Message);
                    _lineRead = _lineRead.Replace("####VENDORNAME####", Vendor_Name);
                    _lineRead = _lineRead.Replace("####PMO_DATE_AND_TIME####", Date_PMO);
                    _lineRead = _lineRead.Replace("####VENDOR_DATE_AND_TIME####", Date_Vendor);
                    _lineRead = _lineRead.Replace("####VENDOR_MESSAGE####", Vendor_Message);
                    _lineRead = _lineRead + line;
                    //counter++;
                }
                file.Close();
                subjectcheck = subjectcheck + subject;
            }
            lblMessageList.Text = _lineRead;
            //_messageID = _messageID + msg_id;


            ///basically if m correct......its overwriting variables . .....hm ik mint may be actions as well
            // read line by lline for vendor compose messages only
            //if (Actions1 == "Send_V_P")
            //    {
            //    System.IO.StreamReader vfile =
            //  new System.IO.StreamReader(Server.MapPath("Vendor_Message.html"));
            //    while ((line = vfile.ReadLine()) != null)
            //        {
            //        _lineRead = _lineRead.Replace("####MESSAGE_ID####", msg_id);
            //        _lineRead = _lineRead.Replace("####SUBJECT####", subject);
            //        _lineRead = _lineRead.Replace("####VENDORNAME####", Vendor_Name);
            //        _lineRead = _lineRead.Replace("####VENDOR_DATE_AND_TIME####", Date_Vendor);
            //        _lineRead = _lineRead.Replace("####VENDOR_MESSAGE####", Vendor_Message);
            //        _lineRead = _lineRead + line;
            //        //counter++;
            //        }

            //    vfile.Close();

            //    //subjectcheck = subjectcheck + subject;
            //    lblMessageList.Text = _lineRead;
            //    }
            //////read line by lline for PMO New messages only
            //if (Actions == "Send_P_V")
            //    {
            //    System.IO.StreamReader pfile =
            //  new System.IO.StreamReader(Server.MapPath("PMO_Message.html"));
            //    while ((line = pfile.ReadLine()) != null)
            //        {
            //        _lineRead = _lineRead.Replace("####MESSAGE_ID####", messid);
            //        _lineRead = _lineRead.Replace("####SUBJECT####", subject);
            //        _lineRead = _lineRead.Replace("####PMONAME####", PMO_Name);
            //        _lineRead = _lineRead.Replace("####PMOMESSAGE####", PMO_Message);
            //        _lineRead = _lineRead.Replace("####PMO_DATE_AND_TIME####", Date_PMO);
            //        _lineRead = _lineRead + line;
            //        // counter++;
            //        }
            //    pfile.Close();
            //    lblMessageList.Text = _lineRead;
            //    subjectcheck = subjectcheck + subject;
            //    }
        }
    }
示例#26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //update timesheet status
        if (Request.QueryString["action"] != null)
        {
            //timesheet popup modal action text
            //lblAction.Text = "Timesheet Action";
            // lblActionTimeSheet.Text = "Are you sure you want to " + Request.QueryString["action"] + " this timesheet?";
            if (Request.QueryString["ModalAction"] != null)
            {
                //update status
                conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString);
                try
                {
                    if (conn.State == System.Data.ConnectionState.Closed)
                    {
                        conn.Open();
                        string _TimeSheetID      = "0";
                        string sqlGetTimeSheetID = "";

                        //start, end and weeks
                        //get timesheetID + 7

                        sqlGetTimeSheetID = " select timesheet_id " +
                                            " from ovms_timesheet " +
                                            " where day =  " + Request.QueryString["fromD"].ToString() + " " +
                                            " and month =  " + Request.QueryString["FromM"].ToString() + " " +
                                            " and year = " + Request.QueryString["FromY"].ToString() + " " +
                                            " and employee_id = " + Request.QueryString["TID"].ToString() + " " +
                                            " and active =  1";

                        SqlCommand    cmdGetTimeSheetID = new SqlCommand(sqlGetTimeSheetID, conn);
                        SqlDataReader rsGetTimeSheetID  = cmdGetTimeSheetID.ExecuteReader();
                        if (rsGetTimeSheetID.HasRows == true)
                        {
                            while (rsGetTimeSheetID.Read())
                            {
                                _TimeSheetID = rsGetTimeSheetID["timesheet_id"].ToString();
                            }
                        }
                        //close
                        rsGetTimeSheetID.Close();
                        cmdGetTimeSheetID.Dispose();

                        string sSQLUpdate = "";
                        string sAction    = "";
                        if (Request.QueryString["action"] == "Approve")
                        {
                            //update
                            sAction    = "Approve";
                            sSQLUpdate = " update ovms_timesheet_details " +
                                         " set timesheet_status_id = 1 " +
                                         " where timesheet_id between " + _TimeSheetID + " and " + (Convert.ToInt32(_TimeSheetID.ToString()) + +Convert.ToInt32("6")) + " " +
                                         " and active = 1";


                            string emp_id     = Request.QueryString["TID"].ToString();
                            string totalhours = Request.QueryString["hours"].ToString();
                            string name       = Request.QueryString["Mess"].ToString();
                            // string vendor_email = Session["Vendor_Email"].ToString();


                            semail.sendEmail("*****@*****.**", "TIMESHEET is approved - (" + name + ")", "<br>Worker ID :" + emp_id +

                                             "<br>Time Sheet Billable Days : 7 days" +
                                             "<br>Time Sheet Billable Hours :" + totalhours +
                                             "<br>******" +
                                             "<br>This notification was sent by FlentisPRO.If you have any questions regarding this notice," +
                                             "<br>please contact the SAP Fieldglass Helpdesk at:" +
                                             "<br>mailto:[email protected]" +
                                             "<br>By Phone:" +
                                             "<br>US(toll free) 1 800 123 1234" +
                                             "<br>Please do not respond to this email, this is an automatic email message and this mailbox is not being monitored.", "", "");
                        }

                        if (Request.QueryString["action"] == "Reject")
                        {
                            //update
                            string emp_id = Request.QueryString["TID"].ToString();
                            string reason_of_rejection = Request.QueryString["reason"].ToString();
                            string day = Request.QueryString["fromD"].ToString();

                            string month = Request.QueryString["FromM"].ToString();
                            string year  = Request.QueryString["FromY"].ToString();
                            // string test = year + month + day;
                            DateTime tsheet_strt_date = Convert.ToDateTime(day + "/" + month + "/" + year);
                            DateTime tsheet_end_date  = tsheet_strt_date.AddDays(7);
                            sAction    = "Reject";
                            sSQLUpdate = " update ovms_timesheet_details " +
                                         " set timesheet_status_id = 2 " +
                                         " where timesheet_id between " + _TimeSheetID + " and " + (Convert.ToInt32(_TimeSheetID.ToString()) + +Convert.ToInt32("6")) + " " +
                                         " and active = 1";
                            sSQLUpdate = sSQLUpdate + " INSERT INTO ovms_timesheet_comments " +
                                         " (timesheet_id, employee_id, timesheet_comments,from_date, to_date)" +
                                         " VALUES(" + _TimeSheetID + "," + emp_id + " , ' " + reason_of_rejection + "','" + tsheet_strt_date + "' , '" + tsheet_end_date + "')";
                            string      emp_id_reject = Request.QueryString["TID"].ToString();
                            API.Service name          = new API.Service();
                            XmlDocument _xmlDoc       = new XmlDocument();
                            _xmlDoc.LoadXml("<XML>" + name.get_employees(Session["Email"].ToString(), Session["P@ss"].ToString(), emp_id_reject, "", "", "", "", "1", "").InnerXml + "</XML>");
                            XmlNodeList ea1   = _xmlDoc.SelectNodes("XML/RESPONSE/EMPLOYEE_NAME_ID");
                            string      name2 = "";
                            name2 = ea1[iResponse].SelectSingleNode("FIRSTNAME").InnerText;
                            string job_name     = ea1[iResponse].SelectSingleNode("JOB_TITLE").InnerText;
                            string vendor_email = Session["Vendor_Email"].ToString();



                            semail.sendEmail("*****@*****.**", "TIMESHEET is rejected - (" + name + ")", "<br>Worker Name :" + name2 +



                                             "<br>******" +
                                             "<br>This notification was sent by FlentisPRO.If you have any questions regarding this notice," +
                                             "<br>please contact the SAP Fieldglass Helpdesk at:" +
                                             "<br>mailto:[email protected]" +
                                             "<br>By Phone:" +
                                             "<br>US(toll free) 1 800 123 1234" +
                                             "<br>Please do not respond to this email, this is an automatic email message and this mailbox is not being monitored.", "", "");
                        }
                        //    Uri uri = new Uri("http://www.opusingats.com/e_Timesheet_Email.aspx?timesheet_id=1");

                        //    string data = "field-keywords=ASP.NET 2.0";

                        //    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
                        //    request.Method = WebRequestMethods.Http.Post;
                        //    request.ContentLength = data.Length;
                        //    request.ContentType = "application/x-www-form-urlencoded";
                        //    StreamWriter writer = new StreamWriter(request.GetRequestStream());
                        //    writer.Write(data);
                        //    writer.Close();
                        //    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                        //    StreamReader reader = new StreamReader(response.GetResponseStream());

                        //    string tmp = reader.ReadToEnd();
                        //    response.Close();
                        //    Response.Write(tmp);
                        //    Response.Write(tmp);

                        //    MailMessage mail = new MailMessage();
                        //    set the addresses
                        //    mail.From = new MailAddress("*****@*****.**"); //IMPORTANT: This must be same as your smtp authentication address.
                        //    mail.To.Add("*****@*****.**");

                        //    set the content
                        //    mail.Subject = "This is an email";
                        //    mail.Body = tmp;
                        //    mail.IsBodyHtml = true;

                        //    send the message
                        //    SmtpClient smtp = new SmtpClient("mail.opusingats.com");

                        //IMPORANT: Your smtp login email MUST be same as your FROM address.
                        //    NetworkCredential Credentials = new NetworkCredential("*****@*****.**", "Maracaibo15@.");
                        //    smtp.Credentials = Credentials;
                        //    smtp.Send(mail);
                        // blMessage.Text = "Mail Sent";
                        SqlCommand cmdUpdateTimeSheet1 = new SqlCommand(sSQLUpdate, conn);
                        int        iUpdate             = cmdUpdateTimeSheet1.ExecuteNonQuery();
                        cmdUpdateTimeSheet1.Dispose();
                    }
                }
                catch (Exception ex)
                {
                    string abc = "";
                }
                finally
                {
                    if (conn.State == System.Data.ConnectionState.Open)
                    {
                        conn.Close();
                    }
                }
            } //end of ModalAction
        }
        Response.Redirect("Client.aspx?TU=True");
        Response.End();
        //end of update timesheet status
    }
示例#27
0
    private void ViewJobsInTable()
    {
        string sTable = "<tbody>";

        API.Service jobInfo = new API.Service();
        XmlDocument xmldoc  = new XmlDocument();

        //xmldoc.LoadXml("<XML>" + jobInfo.get_JobView("*****@*****.**", "ferivan", "2", "", "", "", "", "", "", "").InnerXml + "</XML>");
        xmldoc.LoadXml("<XML>" + jobInfo.get_Jobs("", Session["Email"].ToString(), Session["P@ss"].ToString(), "", Session["UserID"].ToString(), Session["ClientID"].ToString()).InnerXml + "</XML>");
        XmlNodeList Response = xmldoc.SelectNodes("XML/RESPONSE/JOBS ");

        sTable = "";
        int CountRows = 1;

        string _sBackground = "";

        for (int intCount = 0; intCount < Response.Count; intCount++)
        {
            //wrap text for title
            string original_jobtitle = Response[intCount].SelectSingleNode("JOB_TITLE").InnerText;

            string job_title = "";
            if (original_jobtitle.Length > 10)
            {
                job_title = original_jobtitle.Substring(0, original_jobtitle.Length);
            }
            else
            {
                job_title = original_jobtitle;
            }

            string urgent_job = Response[intCount].SelectSingleNode("URGENT").InnerText;
            if (intCount % 2 >= 1)
            {
                //enableordisable = "";
                _sBackground = "bgcolor='#ECF0F1'";
            }
            else
            {
                // enableordisable = "disabled";
                _sBackground = "";
            }

            if (urgent_job == "1")
            {
                sTable = sTable + "<tr " + _sBackground + ">";
                sTable = sTable + "<td style=color:red><blink>" + "Urgent" + "</blink> </td> ";
                sTable = sTable + "<td style=color:red><a target='_blank' style=color:red href='Client_Job_Details.aspx?jopen=Y&p=JV&jobID=" + Response[intCount].SelectSingleNode("JOB_ALIAS").InnerText + "'>" + Response[intCount].SelectSingleNode("JOB_ALIAS").InnerText + "</td>";
                //sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("JOB_TITLE").InnerText.ToString() + "</td> ";
                sTable = sTable + "<td style=color:red>" + func.FixString(job_title) + "</td> ";
                sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("JOB_LOCATION").InnerText.Replace(",Canada", "") + " </td> ";
                sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("NO_OF_OPENINGS").InnerText + " </td> ";
                // sTable = sTable + "<td style=color:red>" + Response[intCount].SelectSingleNode("RECENT").InnerText + " day(s)</td> ";
                sTable = sTable + "<td style=color:red>" + DateTime.Parse(Response[intCount].SelectSingleNode("CONTRACT_START_DATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";
            }
            else

            {
                sTable = sTable + "<tr " + _sBackground + ">";
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("JOB_STATUS").InnerText + " </td> ";

                sTable = sTable + "<td><a  target='_blank' href='Job_Details.aspx?jopen=Y&p=JV&jobID=" + Response[intCount].SelectSingleNode("JOB_ALIAS").InnerText + "'>" + Response[intCount].SelectSingleNode("JOB_ALIAS").InnerText + "</td>";
                //sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("JOB_TITLE").InnerText.ToString() + "</td> ";
                sTable = sTable + "<td>" + func.FixString(job_title) + "</td> ";
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("JOB_LOCATION").InnerText.Replace(",Canada", "") + " </td> ";
                sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("NO_OF_OPENINGS").InnerText + " </td> ";
                // sTable = sTable + "<td>" + Response[intCount].SelectSingleNode("RECENT").InnerText + " day(s)</td> ";
                sTable = sTable + "<td>" + DateTime.Parse(Response[intCount].SelectSingleNode("CONTRACT_START_DATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";

                sTable = sTable + "</tr>";
                CountRows++;
            }
            //closes
            sTable = sTable + "</tbody>";
            jobInfo.Dispose();
            lblTableData.Text = sTable;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Email"] == null)
        {
            //logout
            Session.Abandon();
            Response.Redirect("Login.aspx?m=Your+session+has+timed+out");
            Response.End();
        }
        if (!Page.IsPostBack)
        {
            int jobID = 0;
            if (Request.QueryString["jobID"] != "")
            {
                jobID = Int32.Parse(Request.QueryString["jobID"].Substring(Request.QueryString["jobID"].Length - 5));
            }
            API.Service jobDetails   = new API.Service();
            XmlDocument _xjobDetails = new XmlDocument();
            _xjobDetails.LoadXml("<XML>" + jobDetails.get_Jobs(Convert.ToString(jobID), Session["Email"].ToString(), Session["P@ss"].ToString(), Session["VendorID"].ToString(), Session["UserID"].ToString(), Session["ClientID"].ToString()).InnerXml + "</XML>");
            // _xjobDetails.LoadXml("<XML>" + jobDetails.get_Jobs("2", "*****@*****.**", "ferivan").InnerXml + "</XML>");
            string _Error = "";
            try
            {
                _Error = _xjobDetails.SelectSingleNode("XML/RESPONSE/ERROR").InnerText;
                //_xUserInfo.SelectNodes("XML/RESPONSE/JOB_NO")
            }
            catch (Exception ex)
            {
                _Error = "";
            }
            XmlNodeList Response2 = _xjobDetails.SelectNodes("XML/RESPONSE/JOBS");

            //int CountRows = 1;
            string _Job_Description   = "";
            string _Job_Title         = "";
            string _No_Of_Opennings   = "";
            string _DepartmentName    = "";
            string _ClientName        = "";
            string _Job_Position_Type = "";

            string _Job_Location        = "";
            string _Hours_Per_Day       = "";
            string _Hiring_Manager      = "";
            string _Job_Currency        = "";
            string _Job_TimeZone        = "";
            string _Contract_Start_Date = "";
            string _Contract_End_Date   = "";
            string _Max_submittion      = "";
            string _ReasonForOpen       = "";
            string _Urgent   = "";
            string _PayRate  = "";
            string _comments = "";

            for (int intCount = 0; intCount < Response2.Count; intCount++)
            {
                _Job_Description     = Response2[intCount].SelectSingleNode("JOB_DESC").InnerText;
                _Job_Title           = Server.HtmlDecode(Response2[intCount].SelectSingleNode("JOB_TITLE").InnerText);
                _No_Of_Opennings     = Response2[intCount].SelectSingleNode("NO_OF_OPENINGS").InnerText;
                _DepartmentName      = Response2[intCount].SelectSingleNode("DEPARTMENT_NAME").InnerText;
                _ClientName          = Response2[intCount].SelectSingleNode("CLIENT_NAME").InnerText;
                _Job_Position_Type   = Response2[intCount].SelectSingleNode("JOB_POSITION_TYPE").InnerText;
                _Contract_Start_Date = DateTime.Parse(Response2[intCount].SelectSingleNode("CONTRACT_START_DATE").InnerText).ToString("MMMM dd, yyyy");
                _Contract_End_Date   = DateTime.Parse(Response2[intCount].SelectSingleNode("CONTRACT_END_DATE").InnerText).ToString("MMMM dd, yyyy");
                _Job_Location        = Response2[intCount].SelectSingleNode("JOB_LOCATION").InnerText;
                _Hours_Per_Day       = Response2[intCount].SelectSingleNode("HOURS_PER_DAY").InnerText;
                _Hiring_Manager      = Response2[intCount].SelectSingleNode("HIRING_MANAGER_NAME").InnerText;
                _Job_Currency        = Response2[intCount].SelectSingleNode("JOB_CURRENCY").InnerText;
                //_Contract_Start_Date = Response2[intCount].SelectSingleNode("CONTRACT_START_DATE").InnerText;
                //_Contract_End_Date = Response2[intCount].SelectSingleNode("CONTRACT_END_DATE").InnerText;
                _Job_TimeZone   = Response2[intCount].SelectSingleNode("JOB_TIMEZONE").InnerText;
                _Max_submittion = Response2[intCount].SelectSingleNode("MAX_SUBMISSION_PER_SUPPLIER").InnerText;
                _ReasonForOpen  = Response2[intCount].SelectSingleNode("REASON_FOR_OPEN").InnerText;
                _Urgent         = Response2[intCount].SelectSingleNode("URGENT").InnerText;
                _PayRate        = Response2[intCount].SelectSingleNode("STD_PAY_RATE").InnerText;
                _comments       = Response2[intCount].SelectSingleNode("COMMENTS").InnerText;
            }
            if (_Urgent == "1")
            {
                lblUrgent.Text = "(Urgent Request)";
            }
            DateTime dt  = Convert.ToDateTime(_Contract_Start_Date);
            DateTime dtt = Convert.ToDateTime(_Contract_End_Date);
            lblPostingDate.Text    = dt.ToString("dddd, dd MMMM yyyy HH:mm:ss").Replace("00:00:00", "");
            lbljobtitle.Text       = _Job_Title;
            lblJobDescription.Text = Server.HtmlDecode(_Job_Description);
            //lblNumberofPOsitions.Text = _No_Of_Opennings + " position(s) available, please respond by " + dtt.ToString("dddd, dd MMMM yyyy HH:mm:ss").Replace("00:00:00", ""); ;
            // lblLocation.Text = _Job_Location;
            //lblnoofopning.Text = _No_Of_Opennings;
            //lblstartdate.Text = _Job_Posting_Start_Date;
            //lblenddate.Text = _Job_Posting_End_Date;
            //lbllocation.Text = _Job_Location;
            //lblpayrate.Text = _PayRate;
            if (_comments == "")
            {
                lblcomments.Text = "N/A";
            }
            else
            {
                lblcomments.Text = _comments;
            }



            //API.Service web3 = new API.Service();
            API.Service web3  = new API.Service();
            XmlDocument dom33 = new XmlDocument();
            dom33.LoadXml("<XML>" + web3.get_Jobs(jobID.ToString(), Session["Email"].ToString(), Session["P@ss"].ToString(), Session["VendorID"].ToString(), Session["UserID"].ToString(), Session["ClientID"].ToString()).InnerXml + "</XML>");
            XmlNodeList Response8 = dom33.SelectNodes("XML/RESPONSE/JOBS ");

            lblnoofopning.Text = Response8[iResponse].SelectSingleNode("NO_OF_OPENINGS").InnerText;
            lblstartdate.Text  = DateTime.Parse(Response8[iResponse].SelectSingleNode("CONTRACT_START_DATE").InnerText).ToString("dd MMM, yyyy");

            lblenddate.Text  = DateTime.Parse(Response8[iResponse].SelectSingleNode("CONTRACT_END_DATE").InnerText).ToString("dd MMM, yyyy");
            lblUrgent.Text   = Response8[iResponse].SelectSingleNode("URGENT").InnerText;
            lbljobtitle.Text = Server.HtmlDecode(Response8[iResponse].SelectSingleNode("JOB_TITLE").InnerText);
            string z = Response8[iResponse].SelectSingleNode("STD_PAY_RATE").InnerText;
            if (z == "0")
            {
                x.Visible         = false;
                y.Visible         = true;
                lbllocation2.Text = Response8[iResponse].SelectSingleNode("JOB_LOCATION").InnerText;
                lblbill.Text      = Response8[iResponse].SelectSingleNode("STD_BILL_RATE").InnerText;
                lbladdress2.Text  = Response8[iResponse].SelectSingleNode("ADDRESS1").InnerText;
            }
            else
            {
                y.Visible        = false;
                x.Visible        = true;
                lblpay2.Text     = Response8[iResponse].SelectSingleNode("STD_PAY_RATE").InnerText;
                lbllocation.Text = Response8[iResponse].SelectSingleNode("JOB_LOCATION").InnerText;
                lbladdres.Text   = Response8[iResponse].SelectSingleNode("ADDRESS1").InnerText;
            }
            if (lblUrgent.Text == "1")
            {
                lblUrgent.Text = "(Urgent Request)";
            }
            else
            {
                lblUrgent.Text = "";
            }


            API.Service web1 = new API.Service();
            XmlDocument dom2 = new XmlDocument();
            //string strID = Request.QueryString["ID"];
            dom2.LoadXml("<XML>" + web1.get_rating_with_jobid(Session["Email"].ToString(), Session["P@ss"].ToString(), jobID.ToString()).InnerXml + "</XML>");
            XmlNodeList Response3 = dom2.SelectNodes("XML/RESPONSE/QUESTIONS_NO ");

            string que1               = "";
            string que2               = "";
            string que3               = "";
            string que4               = "";
            string que5               = "";
            string rating1            = "";
            string rating2            = "";
            string rating3            = "";
            string rating4            = "";
            string rating5            = "";
            string emp_id             = "";
            string disable            = "";
            string rejected           = "";
            string more_info          = "";
            string cand_approve       = "";
            string interview_date     = "";
            string interview_confirm1 = "";
            string interview_time     = "";
            string schedule           = "";


            que1 = Server.HtmlDecode(Response3[intCount1].SelectSingleNode("QUESTION1").InnerText);
            if (que1 == "")
            {
                divstar.Visible = false;
            }
            else
            {
                divstar.Visible = true;
            }
            que2    = Response3[intCount1].SelectSingleNode("QUESTION2").InnerText;
            que3    = Response3[intCount1].SelectSingleNode("QUESTION3").InnerText;
            que4    = Response3[intCount1].SelectSingleNode("QUESTION4").InnerText;
            que5    = Response3[intCount1].SelectSingleNode("QUESTION5").InnerText;
            rating1 = Response3[intCount1].SelectSingleNode("RATING1").InnerText;
            rating2 = Response3[intCount1].SelectSingleNode("RATING2").InnerText;
            rating3 = Response3[intCount1].SelectSingleNode("RATING3").InnerText;
            rating4 = Response3[intCount1].SelectSingleNode("RATING4").InnerText;
            rating5 = Response3[intCount1].SelectSingleNode("RATING5").InnerText;

            lblque1.Text    = que1;
            labque2.Text    = que2;
            lblque3.Text    = que3;
            lblque4.Text    = que4;
            lblque5.Text    = que5;
            txtRating1.Text = rating1;
            txtRating2.Text = rating2;
            txtRating3.Text = rating3;
            txtRating4.Text = rating4;
            txtRating5.Text = rating5;

            string sTable = "<tbody>";
            // API.Service web = new API.Service();
            API.Service web  = new API.Service();
            XmlDocument dom1 = new XmlDocument();
            //string strID = Request.QueryString["ID"];
            dom1.LoadXml("<XML>" + web.get_candiate_for_that_particuler_job(Session["Email"].ToString(), Session["P@ss"].ToString(), jobID.ToString(), Session["VendorID"].ToString()).InnerXml + "</XML>");
            XmlNodeList Response1 = dom1.SelectNodes("XML/RESPONSE/EMPLOYEE_NO");

            sTable = "";
            //string _messageVariable = "";

            //   _messageVariable = _messageVariable +

            for (int iResponse2 = 0; iResponse2 < Response1.Count; iResponse2++)
            {
                emp_id = Response1[iResponse2].SelectSingleNode("EMPLOYEE_ID").InnerText;
                if (emp_id.Length > 2)
                {
                    emp_id = (emp_id.Substring(emp_id.Length - 6));
                }

                API.Service getWorkers = new API.Service();
                //  API.Service getWorkers = new API.Service();
                XmlDocument dom3 = new XmlDocument();
                dom1.LoadXml("<XML>" + getWorkers.get_employees(Session["Email"].ToString(), Session["P@ss"].ToString(), emp_id, "", "", "", "", "1", "").InnerXml + "</XML>");
                XmlNodeList Response = dom1.SelectNodes("XML/RESPONSE/EMPLOYEE_NAME_ID");
                sTable = sTable + "<tr>";
                //    sTable = sTable + "<td>" + @" <div class=""checkbox checkbox-single margin-none"">  <input id=""checkAll"" type=""checkbox"" ></input> <label for=""checkbox2"" > Label </label> </div>" + " </TD>";
                //  sTable = sTable + "<td>" + _messageVariable + " </TD>";
                //sTable = sTable + "<td><a href='preview_employee.aspx?empid=" + Response1[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "&jobId=" + Request.QueryString["jobID"] + "'>Edit</a> </td> ";
                sTable = sTable + "<td>" + DateTime.Parse(Response1[iResponse2].SelectSingleNode("SUBMIT_DATE").InnerText).ToString("MMMM dd, yyyy") + " </td>";
                sTable = sTable + "<td>" + Response1[iResponse2].SelectSingleNode("FIRST_NAME").InnerText + " " + Response1[iResponse2].SelectSingleNode("LAST_NAME").InnerText + " </td> ";
                sTable = sTable + "<td>" + Response1[iResponse2].SelectSingleNode("EMAIL").InnerText + " </td> ";
                sTable = sTable + "<td>" + Response1[iResponse2].SelectSingleNode("LOCATION").InnerText + " </td> ";
                sTable = sTable + "<td>" + Response1[iResponse2].SelectSingleNode("STATUS").InnerText + " </td> ";
                sTable = sTable + "<td>" + Response1[iResponse2].SelectSingleNode("PAY_RATE").InnerText + " </td> ";
                sTable = sTable + "<td><a href='" + Response1[iResponse2].SelectSingleNode("RESUME_PATH").InnerText + "'>Resume</a> </td> ";

                try
                {
                    disable            = Response[iResponse2].SelectSingleNode("INTERVIEW_REQUESTED").InnerText;
                    interview_date     = Response[iResponse2].SelectSingleNode("INTERVIEW_DATE").InnerText;
                    interview_time     = Response[iResponse2].SelectSingleNode("INTERVIEW_TIME").InnerText;
                    rejected           = Response[iResponse2].SelectSingleNode("CANDIDATE_REJECTED").InnerText;
                    more_info          = Response[iResponse2].SelectSingleNode("MORE_INFO").InnerText;
                    cand_approve       = Response[iResponse2].SelectSingleNode("CANDIDATE_APPROVE").InnerText;
                    interview_confirm1 = Response[iResponse2].SelectSingleNode("INTERVIEW_CONFIRM").InnerText;
                    schedule           = (interview_date.ToString().Replace("12:00:00 AM", "")) + (interview_time.ToString()).ToString();
                }
                catch (Exception ex)
                {
                    disable            = "";
                    interview_date     = "";
                    interview_time     = "";
                    rejected           = "";
                    more_info          = "";
                    cand_approve       = "";
                    interview_confirm1 = "";
                    schedule           = "";
                }
                DateTime cand_start_date = DateTime.Parse(Response[iResponse2].SelectSingleNode("STARTDATE").InnerText);
                cand_start_date = DateTime.Parse(Response[iResponse2].SelectSingleNode("STARTDATE").InnerText);
                string cand_start_date1 = (cand_start_date.ToString().Replace("12:00:00 AM", ""));
                cand_start_date = DateTime.Parse(Response[iResponse2].SelectSingleNode("STARTDATE").InnerText);
                DateTime contract_start_date = DateTime.Parse(Response[iResponse2].SelectSingleNode("CONTRACT_START_DATE").InnerText);

                if ((interview_date != "") && (rejected == "0") && (more_info == "") && (cand_approve == ""))
                {
                    if ((interview_date != "") && (rejected == "0") && (more_info == "") && (cand_approve == ""))
                    {
                        //sTable = sTable + "<td><a href='Client_View_Worker.aspx?wopen=Y&p=VW&approve=" + Response[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "'class='btn btn-success btn-xs' disabled data-toggle='tooltip' data-placement='top' name='abc' title='Interview Requested'><i class='fa fa-check'></i></a>&nbsp;<a href='Client_View_Worker.aspx?wopen=Y&p=VW&more=" + Response[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "' class='btn btn-default btn-xs' disabled data-toggle='tooltip' data-placement='top' name='abc' title='More details'><i class='fa fa-pencil'></i></a>&nbsp;<a href='Client_View_Worker.aspx?wopen=Y&p=VW&Reject=" + Response[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "' class='btn btn-danger btn-xs' disabled data-toggle='tooltip' data-placement='top' name='abc' title='Reject'><i class='fa fa-times'></i></a></td>";
                        if (interview_confirm1 == "1")
                        {
                            sTable = sTable + "<td>Interview confirm for:<br>" + schedule + "</td>";
                        }
                        else

                        {
                            sTable = sTable + "<td>Interview Requested for:<br>" + schedule + "</td>";
                        }
                    }
                    else

                    {
                        sTable = sTable + "<td>Interview Requested</td>";
                    }
                }
                else

                if ((rejected != "") && (disable == "") && (more_info == "") && (rejected != "0") && (cand_approve == ""))
                {
                    sTable = sTable + "<td>Rejected</td>";
                }
                else

                if ((rejected == "0") && (disable == "") && (more_info != "") && (cand_approve == ""))
                {
                    sTable = sTable + "<td>More Information Needed</td>";
                }
                else

                if ((rejected == "0") && (disable == "") && (more_info == "") && (cand_approve != ""))
                {
                    if (contract_start_date <= cand_start_date)
                    {
                        sTable = sTable + "<td>Working</td>";
                    }
                    else
                    {
                        sTable = sTable + "<td> Candidate set to start on:<br>" + cand_start_date1 + " </td>";
                    }
                }
                else
                {
                    sTable = sTable + "<td><a href='Client_Job_Details.aspx?wopen=Y&p=VW&done=" + Response1[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "&jobID=" + Request.QueryString["jobID"] + "'class='btn btn-success btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='Request for an Interview or Approve candidate'><i class='fa fa-calendar fa-fw'></i></a>&nbsp;<a href='Client_Job_Details.aspx?wopen=Y&p=VW&more=" + Response1[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "&jobID=" + Request.QueryString["jobID"] + "' class='btn btn-default btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Request more details'><i class='fa fa-pencil'></i></a>&nbsp;<a href='Client_Job_Details.aspx?wopen=Y&p=VW&Reject=" + Response1[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "&jobID=" + Request.QueryString["jobID"] + "' class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Reject Candidate'><i class='fa fa-times'></i></a></td>";
                }
                // sTable = sTable + "<td><select name='selDrop'><option name='option1' value='1'>Request For Interview</option><option name='option1' value='2'>Rejected</option><option name='option1' value='3'>More Details</option></select></td>";
                sTable = sTable + "</tr>";
            }
            sTable = sTable + "</tbody>";
            web.Dispose();
            lblTableData.Text = sTable;
        }
    }
示例#29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string sTable = "";

        //get timesheet
        if (Session["Email"] == null)
        {
            //logout
            Session.Abandon();
            Response.Redirect("Login.aspx?m=You+have+logged+out");
            Response.End();
        }
        conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString);

        API.Service jobInfo2 = new API.Service();
        XmlDocument xmldoc11 = new XmlDocument();

        string sTable9 = "<tbody>";

        xmldoc11.LoadXml("<XML>" + jobInfo2.get_name_leave_request(Session["Email"].ToString(), Session["P@ss"].ToString(), Session["VendorID"].ToString(), "", "", Session["ClientID"].ToString()).InnerXml + "</XML>");
        XmlNodeList Response9 = xmldoc11.SelectNodes("XML/RESPONSE/NAME");

        sTable9 = "";
        int CountRows9 = 1;
        int intCount9  = 0;

        for (intCount9 = 0; intCount9 < Response9.Count; intCount9++)
        {
            DateTime requestdate = DateTime.Parse(Response9[intCount9].SelectSingleNode("REQUESTED_DATE").InnerText);
            if (isMoreThanToday(DateTime.Today.Date, requestdate))
            {
                string original = Response9[intCount9].SelectSingleNode("REQUESTED_REASON").InnerText;
                //first option
                string test = original.Substring(0, 4);
                //string reason = Response9[intCount9].SelectSingleNode("REQUESTED_REASON").InnerText;
                //string subreson = reason.Substring(reason.Length -5);
                //0,10
                sTable9 = sTable9 + "<tr>";
                sTable9 = sTable9 + "<td>" + func.FixString(Response9[intCount9].SelectSingleNode("FIRST_NAME").InnerText + " " + Response9[intCount9].SelectSingleNode("LAST_NAME").InnerText) + "</td>";
                sTable9 = sTable9 + "<td>" + DateTime.Parse(Response9[intCount9].SelectSingleNode("REQUESTED_DATE").InnerText).ToString("dd MMM, yyyy") + " </td> ";
                sTable9 = sTable9 + "<td><a href = '#'  data-toggle='tooltip' data-placement='top' name='abc'  title='" + original + "'>" + test + "..." + " </a></td>";
                //  sTable9 = sTable9 + "<td>" + func.FixString(Response9[intCount9].SelectSingleNode("REQUESTED_REASON").InnerText) + " </td> ";
                sTable9 = sTable9 + "<td><a href='#' class='btn btn-primary btn-xs'  data-toggle='tooltip' data-placement='top' name='abc'  title='" + func.FixString(Response9[intCount9].SelectSingleNode("REQUESTED_COMMENTS").InnerText) + "'><i class='fa fa-info-circle'></i></a>&nbsp;</td> ";
                string status = Response9[intCount9].SelectSingleNode("ACTION").InnerText;
                if (status == "2")
                {
                    sTable9 = sTable9 + "<td> Not approved</td>";
                    // sTable9 = sTable9 + "<td>Absence Request Not approved</td>";
                }
                if (status == "1")
                {
                    sTable9 = sTable9 + "<td> Approved</td>";
                    // sTable9 = sTable9 + "<td>Absence Request Not approved</td>";
                }
                if (status == "0")
                {
                    sTable9 = sTable9 + "<td> Rejected</td>";
                    // sTable9 = sTable9 + "<td>Absence Request Not approved</td>";
                }
                sTable9 = sTable9 + "</tr>";
                CountRows9++;
            }
        }

        if (Response9.Count == 0)
        {
            sTable9 = sTable9 + "<td colspan=4>" + "There are no Absence Requests at this time." + "</td> ";
            sTable9 = sTable9 + "</tr>";
        }
        sTable9 = sTable9 + "</tbody>";
        jobInfo2.Dispose();
        lblrequestleave.Text = sTable9;

        if (Request.QueryString["action"] != null)
        {
            //timesheet popup modal action text
            lblAction.Text = "Timesheet Action (Approve)";
            if (Request.QueryString["mess"] != null)
            {
                int DollarTextposition = Request.QueryString["mess"].ToString().Replace("(", "<br>(").IndexOf("for $");
                //Request.QueryString["mess"].ToString().Replace("(", "<br>(").Substring(0, DollarTextposition) + " for " + Request.QueryString["time"].ToString().Replace("(", "<br>(") + " hours";
                //lblActionTimeSheet.Text = "Are you sure you want to " + Request.QueryString["action"] + " the timesheet for <br>" + Request.QueryString["mess"].ToString().Replace("(", "<br>(");
                lblActionTimeSheet.Text = "Are you sure you want to " + Request.QueryString["action"] + " the timesheet for <br>" + Request.QueryString["mess"].ToString().Replace("(", " <br>  ").Substring(0, DollarTextposition) + " for " + Request.QueryString["time"].ToString().Replace("(", " < br > (") + " hours";
            }
        }
        if (Request.QueryString["action2"] != null)
        {
            lblaction2.Text = " Timesheet Action (Reject)";
            int DollarTextposition2 = Request.QueryString["mess"].ToString().Replace("(", "<br>(").IndexOf("for $");
            //Request.QueryString["mess"].ToString().Replace("(", "<br>(").Substring(0, DollarTextposition) + " for " + Request.QueryString["time"].ToString().Replace("(", "<br>(") + " hours";
            //lblActionTimeSheet.Text = "Are you sure you want to " + Request.QueryString["action"] + " the timesheet for <br>" + Request.QueryString["mess"].ToString().Replace("(", "<br>(");
            lblActionTimeSheet2.Text = "Are you sure you want to " + Request.QueryString["action2"] + " the timesheet for <br>" + Request.QueryString["mess"].ToString().Replace("(", " <br>  ").Substring(0, DollarTextposition2) + " for " + Request.QueryString["time"].ToString().Replace("(", " < br > (") + " hours";


            //lblaction2.Text = "Timesheet Action";
            //lblActionTimeSheet2.Text = "Are you sure you want to " + Request.QueryString["action2"] + " this timesheet<br>" + Request.QueryString["mess"].ToString().Replace("(", "<br>(");
        }
        //show timesheets needed to be approved
        try
        {
            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();


                //getJobs
                string strGetTimeSheettobeApproved = " select timesheet_status_id, timesheet_id_from, timesheet_status, weeknum, employee_id, first_name, last_name, pay_rate,job_id,JobManager_ID, " +
                                                     " (select  top 1 CONCAT(month, '-', day, '-', year) from ovms_timesheet  where employee_id = employee_id and DatePart(week, dateadd(d,-1,CONCAT(month, '-', day, '-', year))) = weeknum) as date_from, " +
                                                     " (select sum(a.hours) as hours_total from ovms_timesheet a, ovms_timesheet_details b where a.employee_id = employee_id and a.timesheet_id = b.timesheet_id and a.active = 1 and b.active = 1 and b.timesheet_status_id = 3 and DatePart(week, dateadd(d, -1, CONCAT(a.month, '-', a.day, '-', a.year))) = weeknum) as hours_reported, " +
                                                     " (select  top 1 dateadd(d,6,CONCAT(month, '-', day, '-', year)) from ovms_timesheet  where employee_id = employee_id and DatePart(week, dateadd(d,-1,CONCAT(month, '-', day, '-', year))) = weeknum) as date_to " +
                                                     " from (select distinct ts.timesheet_status_id, " +
                                                     " ts.timesheet_status, e.job_id, " +
                                                     " (select user_id from ovms_jobs where job_id = e.job_id) as JobManager_ID, " +
                                                     " DatePart(week, dateadd(d,-1,CONCAT(month, '-', day, '-', year))) as weeknum, " +
                                                     " (select top 1 a.timesheet_id from ovms_timesheet a, ovms_timesheet_details b where a.timesheet_id = b.timesheet_id and a.employee_id =e.employee_id and a.active = 1 and b.active = 1 and b.timesheet_status_id=3) as timesheet_id_from,	 " +
                                                     " e.employee_id, " +
                                                     " dbo.CamelCase(ed.first_name) as first_name, " +
                                                     " dbo.CamelCase(ed.last_name) as last_name, " +
                                                     " ed.pay_rate " +
                                                     " from ovms_timesheet_status as ts  " +
                                                     " join ovms_timesheet_details as td " +
                                                     " on ts.timesheet_status_id = td.timesheet_status_id " +
                                                     " join ovms_timesheet as t " +
                                                     " on td.timesheet_id = t.timesheet_id " +
                                                     " join ovms_employees as e " +
                                                     " on t.employee_id = e.employee_id " +
                                                     " join ovms_employee_details as ed " +
                                                     " on e.employee_id = ed.employee_id  " +
                                                     " where ts.timesheet_status_id=3 " +
                                                     " and e.client_id = " + Session["ClientID"].ToString() + " " +
                                                     " and e.active = 1) as times " +
                                                     " where timesheet_status_id=3 " +
                                                     " and JobManager_ID= " + Session["UserID"].ToString() + " order by first_name asc";

                SqlCommand    cmdGetTimeSheets    = new SqlCommand(strGetTimeSheettobeApproved, conn);
                SqlDataReader readerGetTimeSheets = cmdGetTimeSheets.ExecuteReader();
                sTable = sTable + "<tbody>";
                if (readerGetTimeSheets.HasRows == true)
                {
                    while (readerGetTimeSheets.Read())
                    {
                        string hours = readerGetTimeSheets["HOURS_REPORTED"].ToString();
                        string chk   = "1";
                        string chk2  = "1";

                        //DateTime.Parse(readerGetTimeSheets["DATE+_FROM"].ToString()).ToString("dd MMM, yyyy") +
                        string sAction = readerGetTimeSheets["timesheet_status"].ToString();
                        sTable = sTable + "<tr>";
                        sTable = sTable + "<td>" + func.FixString(readerGetTimeSheets["FIRST_NAME"].ToString()) + " " + func.FixString(readerGetTimeSheets["LAST_NAME"].ToString()) + "<p>(" + DateTime.Parse(readerGetTimeSheets["DATE_FROM"].ToString()).ToString("dd MMM, yyyy") + " - " + DateTime.Parse(readerGetTimeSheets["DATE_TO"].ToString()).ToString("dd MMM, yyyy") + ")</p></td> ";
                        //sTable = sTable + "<td>" + string.Format("{0:c0}", Convert.ToDouble(readerGetTimeSheets["PAY_RATE"].ToString()) * Convert.ToDouble(readerGetTimeSheets["HOURS_REPORTED"].ToString())) + " </td> ";
                        sTable = sTable + "<td>" + readerGetTimeSheets["HOURS_REPORTED"].ToString() + " </td> ";                        //sTable = sTable + "<td class='text-right width-100'><a href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=123&action=Approve&fromD=1&FromM=1&FromY=1' class='btn btn-success btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='Approve TimeSheet'><i class='fa fa-check'></i></a>&nbsp;<a href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=1&action=Reject&fromD=1&FromM=1&FromY=1' class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Reject TimeSheet'><i class='fa fa-times'></i></a></td>";
                        sTable = sTable + "<td class='text-right width-100'><a href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=" + readerGetTimeSheets["employee_id"].ToString() + "' class='btn btn-warning btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='View Details'><i class='fa fa-table'></i></a>&nbsp;<a href='Client.aspx?TID=" + readerGetTimeSheets["employee_id"].ToString() + "&chk=" + chk + "&time=" + hours + "&action=Approve&fromD=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Day.ToString() + "&FromM=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Month.ToString() + "&FromY=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Year.ToString() + "&Mess=" + Server.UrlEncode(func.FixString(readerGetTimeSheets["FIRST_NAME"].ToString()) + " " + func.FixString(readerGetTimeSheets["LAST_NAME"].ToString())) + " (" + DateTime.Parse(readerGetTimeSheets["DATE_FROM"].ToString()).ToString("dd MMM, yyyy") + " - " + DateTime.Parse(readerGetTimeSheets["DATE_TO"].ToString()).ToString("dd MMM, yyyy") + ") for " + string.Format("{0:c0}", Convert.ToDouble(readerGetTimeSheets["PAY_RATE"].ToString()) * Convert.ToDouble(readerGetTimeSheets["HOURS_REPORTED"].ToString())) + "' class='btn btn-success btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='Approve Timesheet'><i class='fa fa-check'></i></a>&nbsp;<a href='Client.aspx?TID=" + readerGetTimeSheets["employee_id"].ToString() + "&chk2=" + chk2 + "&time=" + hours + "&action2=reject&fromD=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Day.ToString() + "&FromM=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Month.ToString() + "&FromY=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Year.ToString() + "&Mess=" + Server.UrlEncode(func.FixString(readerGetTimeSheets["FIRST_NAME"].ToString()) + " " + func.FixString(readerGetTimeSheets["LAST_NAME"].ToString())) + "(" + DateTime.Parse(readerGetTimeSheets["DATE_FROM"].ToString()).ToString("dd MMM, yyyy") + " - " + DateTime.Parse(readerGetTimeSheets["DATE_TO"].ToString()).ToString("dd MMM, yyyy") + ") for " + string.Format("{0:c0}", Convert.ToDouble(readerGetTimeSheets["PAY_RATE"].ToString()) * Convert.ToDouble(readerGetTimeSheets["HOURS_REPORTED"].ToString())) + "' class='btn btn-danger btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='Reject Timesheet'><i class='fa fa-times'></i></a>&nbsp;</i></a></td>";
                        //sTable = sTable + "<td class='text-right width-100'><a href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=" + readerGetTimeSheets["employee_id"].ToString() + "' class='btn btn-warning btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='View Details'><i class='fa fa-table'></i></a>&nbsp;<a href='Client.aspx?TID=" + readerGetTimeSheets["employee_id"].ToString() + "&action=Approve&fromD=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Day.ToString() + "&FromM=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Month.ToString() + "&FromY=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Year.ToString() + "&Mess=" + Server.UrlEncode(func.FixString(readerGetTimeSheets["FIRST_NAME"].ToString()) + " " + func.FixString(readerGetTimeSheets["LAST_NAME"].ToString())) + "(" + DateTime.Parse(readerGetTimeSheets["DATE_FROM"].ToString()).ToString("dd MMM, yyyy") + " - " + DateTime.Parse(readerGetTimeSheets["DATE_TO"].ToString()).ToString("dd MMM, yyyy") + ") for " + string.Format("{0:c0}", Convert.ToDouble(readerGetTimeSheets["PAY_RATE"].ToString()) * Convert.ToDouble(readerGetTimeSheets["HOURS_REPORTED"].ToString())) + "' class='btn btn-success btn-xs'  data-toggle='tooltip' data-placement='top' name='abc' title='Approve Timesheet'><i class='fa fa-check'></i></a>&nbsp;<a href='Client.aspx?TID=" + readerGetTimeSheets["employee_id"].ToString() + "&action=Approve&fromD=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Day.ToString() + "&FromM=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Month.ToString() + "&FromY=" + Convert.ToDateTime(readerGetTimeSheets["date_from"].ToString()).Year.ToString() + "' class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Reject TimeSheet'><i class='fa fa-times'></i></a></td>";
                        //sTable = sTable = "<td>12</td>";
                        //C_TimeSheet_View.aspx?topen=Y&p=VT&TID=1
                        sTable = sTable + "</tr>";
                        //string a = "";
                        //}
                    }

                    // lblJobs.Text = reader["num_of_jobs"].ToString();
                    //lblVendors.Text  = reader["num_of_jobs"].ToString();
                }
                else
                {
                    sTable = sTable + "<tr>";
                    sTable = sTable + "<td colspan=3>No Timesheets to be approved</td>";
                    sTable = sTable + "</tr>";
                }

                sTable = sTable + "</tbody>";
                readerGetTimeSheets.Close();
                cmdGetTimeSheets.Dispose();
                lblTableData.Text = sTable;
            }
        }
        catch (Exception ex)
        {
            //
        }
        finally
        {
            if (conn.State == System.Data.ConnectionState.Open)
            {
                conn.Close();
            }
        }



        //for (int iResponse = 0; iResponse < Response.Count; iResponse++)
        //{

        //sstring.Format("{0:c0}", (8 * Convert.ToDouble(PayRate) * Convert.ToDouble(ContractLength)));
        //sTable = sTable + "<tr>";
        //sTable = sTable + "<td>" + func.FixString(Response[iResponse].SelectSingleNode("FIRST_NAME").InnerText + " " + Response[iResponse].SelectSingleNode("LAST_NAME").InnerText) + "</td> ";
        //sTable = sTable + "<td>" + string.Format("{0:c0}",Convert.ToDouble(Response[iResponse].SelectSingleNode("PAY_RATE").InnerText)  * Convert.ToDouble(Response[iResponse].SelectSingleNode("HOURS").InnerText))+ " </td> ";
        //sTable = sTable + "<td><a href='approve_timesheet.aspx?wopen=Y&p=VW&empid=" + Response[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "'class='btn btn-success btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Approve'><i class='fa fa-check'></i></a>&nbsp;<a href='show_timesheet.aspx?wopen=Y&p=VW&empid=" + Response[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "' class='btn btn-default btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='More details'><i class='fa fa-pencil'></i></a>&nbsp;<a href='decline_timesheet.aspx?wopen=Y&p=VW&empid=" + Response[iResponse].SelectSingleNode("EMPLOYEE_ID").InnerText + "' class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Reject'><i class='fa fa-times'></i></a></td>";
        //sTable = sTable + "</tr>";
        //string a = "";
        //}

        //sTable = sTable + "</tbody>";
        //getWorkers.Dispose();
        //lblTableData.Text = sTable;

        //}
        //table end

        if (Session["Email"] == null)
        {
            //logout
            Session.Abandon();
            Response.Redirect("Login.aspx?m=Your+session+has+timed+out");
            Response.End();
        }
        conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString);


        //vendor contribution
        VendorContribution();
        //get recently added by manager
        //recently added jobs API
        API.Service web = new API.Service();

        // XmlDocument _xmlWorkers = new XmlDocument();

        //Create XML Stuff
        XmlDocument _xmlDoc = new XmlDocument();
        XmlNodeList nodeList;
        string      _Error   = "";
        int         intCount = 1;

        //Load XML Element into document
        _xmlDoc.LoadXml("<XML>" + web.get_Recent_jobs(Session["Email"].ToString(), Session["P@ss"].ToString(), Session["UserTypeID"].ToString(), Session["UserID"].ToString(), "").InnerXml + "</XML>");
        //loop through
        nodeList = _xmlDoc.SelectNodes("XML/RESPONSE/JOB_ID");
        string strGOTO = "";
        //declare variables

        string strjob = "";

        intCount = nodeList.Count;
        try
        {
            //_Error = nodeList[0].SelectSingleNode("JOB_ALIAS").InnerText;
            //_Error = nodeList[0].ChildNodes[0].SelectSingleNode("JOB_ALIAS").InnerText;
            _Error = nodeList[0].SelectSingleNode("JOB_ALIAS").InnerText;
        }
        catch (Exception ex)
        {
            _Error = "error";
        }
        if (_Error == "error")
        {
            strjob = strjob + @"<li class=""list-group-item"">" +
                     @"<div id=""lbl1"" runat=""server"">" +
                     @"No jobs have been added " +
                     @"</div>" +
                     @"</li>";
        }
        else
        {
            int i = 0;
            //loop through nodes
            foreach (XmlNode book in nodeList)
            {
                //job id show jobs
                strjob = strjob + @"<li class=""list-group-item"">" +
                         @"<div id=""lbl1"" runat=""server"">" +
                         @"		<span class='label label-default'>"+ nodeList[i].SelectSingleNode("JOB_ALIAS").InnerText + "</span>&nbsp;<a href='Client_Job_Details.aspx?jopen=Y&p=JV&jobID=" + nodeList[i].SelectSingleNode("JOB_ALIAS").InnerText + "'><b>" + func.FixString(nodeList[i].SelectSingleNode("JOB_TITLE").InnerText) + "</b><br>" +
                         @"		"+ nodeList[i].SelectSingleNode("NO_OF_OPENINGS").InnerText + " position(s) | " + func.FixString(nodeList[i].SelectSingleNode("LOCATION").InnerText) + " - " + nodeList[i].SelectSingleNode("LENGTH_OF_DAYS").InnerText + " day(s)  </a>" +
                         @"</div>" +
                         @"</li>";
                if (i == 0)
                {
                    strGOTO = @"<li class=""list-group-item text-right"">" +
                              @"<a class=""btn btn-sm btn-primary"" href=""Add_jobs.aspx?jopen=Y&p=JA"">Add a Job<i class=""fa fa-fw fa-arrow-right""></i></a>" +
                              @"</li>";
                }

                //increment
                i = i + 1;
            }
        }
        lblshowrecentlyadded.Text = strjob + strGOTO;

        //get top vendor
        API.Service gettopvendor = new API.Service();
        //get_all_vendors_for_a_client
        XmlDocument XMLDoc = new XmlDocument();

        XMLDoc.LoadXml("<XML>" + gettopvendor.get_all_vendors_for_a_client(Session["ClientID"].ToString(), Session["Email"].ToString(), Session["P@ss"].ToString()).InnerXml + "</XML>");
        XmlNodeList xResponse       = XMLDoc.SelectNodes("XML/RESPONSE/VENDORS");
        string      _sTopVendorName = "";

        for (int iResponse = 0; iResponse < xResponse.Count; iResponse++)
        {
            if (iResponse == 0)
            {
                _sTopVendorName = xResponse[iResponse].SelectSingleNode("VENDOR_NAME").InnerText.ToUpper();
                break;
            }
            iResponse = iResponse + 1;
        }

        lblTopVendorName.Text = _sTopVendorName;
        try
        {
            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();


                //getJobs
                string        strSQLGetJobs = "select count(*) as num_of_jobs from ovms_jobs where client_ID = " + Session["ClientID"].ToString() + " and active = 1 ";
                SqlCommand    cmdGetJobs    = new SqlCommand(strSQLGetJobs, conn);
                SqlDataReader reader        = cmdGetJobs.ExecuteReader();
                while (reader.Read())
                {
                    lblJobs.Text = reader["num_of_jobs"].ToString();
                    //lblVendors.Text  = reader["num_of_jobs"].ToString();
                }
                reader.Close();
                cmdGetJobs.Dispose();
                //getVendors
                string        strSQLGetVendors = "select count(*) as NumVendors from  ovms_users where utype_id = 2 and client_id =" + Session["ClientID"].ToString() + " and active = 1 ";
                SqlCommand    cmdGetVendors    = new SqlCommand(strSQLGetVendors, conn);
                SqlDataReader readerVendors    = cmdGetVendors.ExecuteReader();
                while (readerVendors.Read())
                {
                    lblVendors.Text = readerVendors["NumVendors"].ToString();
                    //lblVendors.Text  = reader["num_of_jobs"].ToString();
                }
                readerVendors.Close();
                cmdGetVendors.Dispose();
            }
        }
        catch (Exception ex)
        {
            //
        }
        finally
        {
            if (conn.State == System.Data.ConnectionState.Open)
            {
                conn.Close();
            }
        }
    }
示例#30
0
 public void CustomersInsidePer24HTest()
 {
     var service = new API.Service();
     var list    = service.CustomersInsidePer24H(DateTime.Now.AddDays(-8), DateTime.Now.AddDays(-7));
 }