Exemplo n.º 1
0
    private void initTraining(int ID)
    {
        hdfID.Value = ID.ToString();
        Training     trainingHandler = new Training();
        TrainingInfo trainingInfo    = trainingHandler.getTraining(ID);

        txtVersionNo.InnerText = trainingInfo.VersionNo.ToString("N");
        hdfVersionNo.Value     = trainingInfo.VersionNo.ToString("N");
        string[] serailNoArray = trainingInfo.SerialNo.Split('-');
        txtSerialNo0.InnerText = serailNoArray[0] + "-" + serailNoArray[1];
        txtSerialNo1.Value     = serailNoArray[2];
        txtSerialNo2.Value     = serailNoArray[3];

        txtName.Value = trainingInfo.Name;
        //comType.Value = trainingInfo.Type;


        bool isAbandoned = true;

        foreach (ListItem item in comType.Items)
        {
            if (item.Value == trainingInfo.Type.ToString())
            {
                item.Selected = true;
                isAbandoned   = false;
                break;
            }
            else
            {
                item.Selected = false;
            }
        }
        if (isAbandoned)
        {
            string description = SystemPara.getDescription(trainingInfo.Type);
            comType.Items.Add(new ListItem(description, trainingInfo.Type.ToString()));
            comType.Value = trainingInfo.Type.ToString();
        }


        txtMaxAttendance.Value        = trainingInfo.MaxAttendance.ToString();
        chkOptionalAttendance.Checked = trainingInfo.OptionalAttendance;
        txtContactPerson.Value        = trainingInfo.ContactPerson;
        txtDepartment.Value           = trainingInfo.Department;

        txtDetails.Value     = trainingInfo.Details;
        txtLocation.Value    = trainingInfo.Location;
        txtPhoneNumber.Value = trainingInfo.PhoneNumber;
        txtEmail.Value       = trainingInfo.Email;
        //txtFormPath.Value = trainingInfo.FormPath;

        //new icon
        if (trainingInfo.NewIconInfo != null)
        {
            txtIconExpiryDay.Value = trainingInfo.NewIconInfo.ExpiryDate.ToString(GlobalSetting.DateTimeFormat);
        }

        dateDeadline.Value = trainingInfo.Deadline.ToString(GlobalSetting.DateTimeFormat);
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string type = Request.QueryString["type"];
        string from = Request.QueryString["from"];
        string to   = Request.QueryString["to"];

        string[] typeIDArray = type.Split(',');
        string   typeDesc    = "";

        if (type != "0")
        {
            foreach (string id in typeIDArray)
            {
                if (typeDesc == "")
                {
                    typeDesc = SystemPara.getDescription(Convert.ToInt32(id));
                }
                else
                {
                    typeDesc = typeDesc + ", " + SystemPara.getDescription(Convert.ToInt32(id));
                }
            }
        }


        DateTime fromDate = DateTime.MinValue;
        DateTime toDate   = DateTime.MinValue;

        txtType.InnerText = typeDesc;

        DateTime.TryParseExact(from, "dd/MM/yyyy", new CultureInfo("en-US"), DateTimeStyles.None, out fromDate);
        DateTime.TryParseExact(to, "dd/MM/yyyy", new CultureInfo("en-US"), DateTimeStyles.None, out toDate);

        if (fromDate == DateTime.MinValue && toDate == DateTime.MinValue)
        {
            txtDateRange.InnerText = "ALL";
        }
        else
        {
            txtDateRange.InnerText = (fromDate == DateTime.MinValue ? "" : fromDate.ToString("dd/MM/yyyy"))
                                     + " ~ "
                                     + (toDate == DateTime.MinValue ? "" : toDate.ToString("dd/MM/yyyy"));
        }

        reportStr = new Report().getSuggestionReport(type, fromDate, toDate,
                                                     Session["LOGINID"].ToString(), Session["USERGROUP"].ToString());
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int ID = Convert.ToInt32(Request.QueryString["ID"]);

        trainingID.Value = ID.ToString();
        CareerOpportunity     careerOpportunityHandler = new CareerOpportunity();
        CareerOpportunityInfo careerOpportunityInfo    = careerOpportunityHandler.getCareerOpportunity(ID);

        txtCareerLevel.InnerText   = careerOpportunityInfo.CareerLevel;
        txtQualification.InnerText = SystemPara.getDescription(careerOpportunityInfo.Qualification);
        txtDetails.InnerHtml       = careerOpportunityInfo.Details;
        txtEmail.HRef            = "mailto:" + careerOpportunityInfo.Email;
        txtEmail.InnerText       = careerOpportunityInfo.Email;
        txtExp.InnerText         = careerOpportunityInfo.Experience.ToString();
        txtJobFunction.InnerText = SystemPara.getDescription(careerOpportunityInfo.JobFunction);
        txtDivision.InnerText    = SystemPara.getDescription(careerOpportunityInfo.Division);
        txtDepartment.InnerText  = SystemPara.getDescription(careerOpportunityInfo.Department);
        txtLocation.InnerText    = careerOpportunityInfo.Location;
        //txtQualification.InnerText = SystemPara.getDescription(careerOpportunityInfo.Qualification);
        // txtSalary.InnerText = careerOpportunityInfo.Salary.ToString();
        txtType.InnerText       = SystemPara.getDescription(careerOpportunityInfo.EmploymentType);
        txtDisclaimer.InnerText = careerOpportunityInfo.Disclaimer;
    }
Exemplo n.º 4
0
    public string getSuggestionReport(string type, DateTime from, DateTime to,
                                      string loginID, string userGroup)
    {
        bool blankFromDate = from == DateTime.MinValue;
        bool blankToDate   = to == DateTime.MinValue;

        int eventTotal = 0;

        System.Text.StringBuilder strBuilder = new System.Text.StringBuilder();
        string sql = "select "
                     + "UserName \"User Name\", "
                     + "Email, "
                     + "Suggestion, "
                     + "Convert(varchar,CreateDate, 103) + ' ' + "
                     + "left(Convert(varchar,CreateDate, 114),5) \"Date & Time\" "
                     + "from Suggestion "
                     + "where Type in (" + type + ") "
                     + (blankFromDate ? "" : "and cast(CreateDate As Date) >= @StartTime ")
                     + (blankToDate ? "" : "and cast(CreateDate As Date) <= @EndTime ");

        Dictionary <string, object> dict = new Dictionary <string, object>();

        dict.Add("@Category", GlobalSetting.ArticleCategory.Training);
        dict.Add("@LoginID", loginID);
        if (!blankFromDate)
        {
            dict.Add("@StartTime", from);
        }
        if (!blankToDate)
        {
            dict.Add("@EndTime", to);
        }

        dbAccess.open();

        try
        {
            System.Data.DataTable dt = dbAccess.select(sql, dict);
            strBuilder.Append("<table class='ReportTable'>");
            strBuilder.Append("<tr>");
            foreach (System.Data.DataColumn col in dt.Columns)
            {
                if (col.ColumnName == "ID")
                {
                    continue;
                }
                strBuilder.Append("<th>");
                strBuilder.Append(col.ColumnName);
                strBuilder.Append("</th>");
            }
            strBuilder.Append("</tr>");


            foreach (System.Data.DataRow row in dt.Rows)
            {
                eventTotal++;
                strBuilder.Append("<tr>");
                foreach (System.Data.DataColumn col in dt.Columns)
                {
                    if (col.ColumnName == "ID")
                    {
                        continue;
                    }
                    strBuilder.Append("<td>");

                    if (col.ColumnName == "Type")
                    {
                        strBuilder.Append(SystemPara.getDescription(Convert.ToInt32(row[col.ColumnName])));
                    }
                    else
                    {
                        strBuilder.Append(row[col.ColumnName].ToString());
                    }

                    strBuilder.Append("</td>");
                }

                strBuilder.Append("</tr>");
            }
            strBuilder.Append("</table>");
            strBuilder.Append("<br/><div><span>Suggestion Total: </span>" + eventTotal.ToString() + "<div>");
        }
        catch
        {
            throw;
        }
        finally
        {
            dbAccess.close();
        }

        return(strBuilder.ToString());
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        initControl();
        string serialNo = Request.QueryString["serialNo"];
        string name     = Request.QueryString["name"];
        string from     = Request.QueryString["from"];
        string to       = Request.QueryString["to"];
        string type     = Request.QueryString["type"];
        string decision = Request.QueryString["decision"];

        DateTime fromDate = DateTime.MinValue;
        DateTime toDate   = DateTime.MinValue;

        string[] typeIDArray   = type.Split(',');
        string[] decisionArray = decision.Split(',');
        string   typeDesc      = "";
        string   decisionDesc  = "";

        if (type != "0")
        {
            foreach (string id in typeIDArray)
            {
                if (typeDesc == "")
                {
                    typeDesc = SystemPara.getDescription(Convert.ToInt32(id));
                }
                else
                {
                    typeDesc = typeDesc + ", " + SystemPara.getDescription(Convert.ToInt32(id));
                }
            }
        }
        if (decision != "'0'")
        {
            foreach (string decisionItem in decisionArray)
            {
                if (decisionDesc == "")
                {
                    decisionDesc = (decisionItem == "'NotAttend'" ? "Not Attend" : decisionItem.Replace("'", ""));
                }
                else
                {
                    decisionDesc = decisionDesc + ", " + (decisionItem == "'NotAttend'" ? "Not Attend" : decisionItem.Replace("'", ""));
                }
            }
        }

        txtType.InnerText     = typeDesc;
        txtDecision.InnerText = decisionDesc;

        if (string.IsNullOrEmpty(serialNo))
        {
            txtSerialNo.InnerText = "ALL";
        }
        else
        {
            txtSerialNo.InnerText = serialNo;
        }
        if (string.IsNullOrEmpty(name))
        {
            txtName.InnerText = "ALL";
        }
        else
        {
            txtName.InnerText = name;
        }

        DateTime.TryParseExact(from, "dd/MM/yyyy", new CultureInfo("en-US"), DateTimeStyles.None, out fromDate);
        DateTime.TryParseExact(to, "dd/MM/yyyy", new CultureInfo("en-US"), DateTimeStyles.None, out toDate);

        if (fromDate == DateTime.MinValue && toDate == DateTime.MinValue)
        {
            txtDateRange.InnerText = "ALL";
        }
        else
        {
            txtDateRange.InnerText = (fromDate == DateTime.MinValue ? "" : fromDate.ToString("dd/MM/yyyy"))
                                     + " ~ "
                                     + (toDate == DateTime.MinValue ? "" : toDate.ToString("dd/MM/yyyy"));
        }

        reportStr = new Report().getEventReport(serialNo, type, decision, name, fromDate, toDate,
                                                Session["LOGINID"].ToString(), Session["USERGROUP"].ToString());
    }
Exemplo n.º 6
0
    protected void initArticle(int ID)
    {
        hdfID.Value = ID.ToString();

        News     newsHandler = new News();
        NewsInfo newInfo     = newsHandler.getArticle(ID);

        txtVersionNo.InnerText = newInfo.VersionNo.ToString("N");

        string[] serialNos = newInfo.SerialNo.Split('-');
        txtSerialNo0.InnerText = serialNos[0] + "-" + serialNos[1];
        txtSerialNo1.Value     = serialNos[2];
        txtSerialNo2.Value     = serialNos[3];

        // comType.Value = newInfo.Type;

        bool isAbandoned = true;

        foreach (ListItem item in comType.Items)
        {
            if (item.Value == newInfo.Type.ToString())
            {
                item.Selected = true;
                isAbandoned   = false;
                break;
            }
            else
            {
                item.Selected = false;
            }
        }
        if (isAbandoned)
        {
            string description = SystemPara.getDescription(newInfo.Type);
            comType.Items.Add(new ListItem(description, newInfo.Type.ToString()));
            comType.Value = newInfo.Type.ToString();
        }


        txtTitle.Value    = newInfo.Title;
        txtHeadline.Value = newInfo.Headline;
        txtSummary.Value  = newInfo.Summary;
        txtMainBody.Value = newInfo.Content;

        ddlYear.SelectedIndex  = -1;
        ddlMonth.SelectedIndex = -1;
        ddlDay.SelectedIndex   = -1;
        foreach (ListItem item in ddlYear.Items)
        {
            if (item.Value == newInfo.EffectiveDate.Year.ToString())
            {
                item.Selected = true;
                break;
            }
        }
        foreach (ListItem item in ddlMonth.Items)
        {
            if (item.Value == newInfo.EffectiveDate.Month.ToString("00"))
            {
                item.Selected = true;
                break;
            }
        }
        foreach (ListItem item in ddlDay.Items)
        {
            if (item.Value == newInfo.EffectiveDate.Day.ToString("00"))
            {
                item.Selected = true;
                break;
            }
        }


        if (newInfo.NewIconInfo != null)
        {
            ddlIconExpiryYear.SelectedIndex  = -1;
            ddlIconExpiryMonth.SelectedIndex = -1;
            ddlIconExpiryDay.SelectedIndex   = -1;
            foreach (ListItem item in ddlIconExpiryYear.Items)
            {
                if (item.Value == newInfo.NewIconInfo.ExpiryDate.Year.ToString())
                {
                    item.Selected = true;
                    break;
                }
            }
            foreach (ListItem item in ddlIconExpiryMonth.Items)
            {
                if (item.Value == newInfo.NewIconInfo.ExpiryDate.Month.ToString("00"))
                {
                    item.Selected = true;
                    break;
                }
            }
            foreach (ListItem item in ddlIconExpiryDay.Items)
            {
                if (item.Value == newInfo.NewIconInfo.ExpiryDate.Day.ToString("00"))
                {
                    item.Selected = true;
                    break;
                }
            }
        }
    }
Exemplo n.º 7
0
    protected void initCareer(int ID)
    {
        hdfID.Value = ID.ToString();
        CareerOpportunity     careerOpportunity     = new CareerOpportunity();
        CareerOpportunityInfo careerOpportunityInfo = careerOpportunity.getCareerOpportunity(ID);

        txtVersionNo.InnerText = careerOpportunityInfo.VersionNo.ToString("N");
        string[] serialNoArray = careerOpportunityInfo.SerialNo.Split('-');
        txtSerialNo0.InnerText = serialNoArray[0] + "-" + serialNoArray[1];
        txtSerialNo1.Value     = serialNoArray[2];
        txtSerialNo2.Value     = serialNoArray[3];
        //comType.Value = careerOpportunityInfo.Type;


        //new icon
        if (careerOpportunityInfo.NewIconInfo != null)
        {
            txtIconExpiryDay.Value = careerOpportunityInfo.NewIconInfo.ExpiryDate.ToString(GlobalSetting.DateTimeFormat);
        }


        bool isAbandoned = true;

        foreach (ListItem item in comType.Items)
        {
            if (item.Value == careerOpportunityInfo.Type.ToString())
            {
                item.Selected = true;
                isAbandoned   = false;
                break;
            }
            else
            {
                item.Selected = false;
            }
        }
        if (isAbandoned)
        {
            string description = SystemPara.getDescription(careerOpportunityInfo.Type);
            comType.Items.Add(new ListItem(description, careerOpportunityInfo.Type.ToString()));
            comType.Value = careerOpportunityInfo.Type.ToString();
        }
        txtCareerLevel.Value = careerOpportunityInfo.CareerLevel;
        txtExp.Value         = (careerOpportunityInfo.Experience + 100.001).ToString().Substring(1, 5);
        //comQualification.Value = careerOpportunityInfo.Qualification.ToString();
        isAbandoned = true;
        foreach (ListItem item in comQualification.Items)
        {
            if (item.Value == careerOpportunityInfo.Qualification.ToString())
            {
                item.Selected = true;
                isAbandoned   = false;
                break;
            }
            else
            {
                item.Selected = false;
            }
        }
        if (isAbandoned)
        {
            string description = SystemPara.getDescription(careerOpportunityInfo.Qualification);
            comQualification.Items.Add(new ListItem(description, careerOpportunityInfo.Qualification.ToString()));
            comQualification.Value = careerOpportunityInfo.Qualification.ToString();
        }


        /////---------------1

        isAbandoned = true;
        foreach (ListItem item in txtJobFunction.Items)
        {
            if (item.Value == careerOpportunityInfo.JobFunction.ToString())
            {
                item.Selected = true;
                isAbandoned   = false;
                break;
            }
            else
            {
                item.Selected = false;
            }
        }
        if (isAbandoned)
        {
            string description = SystemPara.getDescription(careerOpportunityInfo.JobFunction);
            txtJobFunction.Items.Add(new ListItem(description, careerOpportunityInfo.JobFunction.ToString()));
            txtJobFunction.Value = careerOpportunityInfo.JobFunction.ToString();
        }
        /////---------------

        /////---------------2

        isAbandoned = true;
        foreach (ListItem item in txtDivision.Items)
        {
            if (item.Value == careerOpportunityInfo.Division.ToString())
            {
                item.Selected = true;
                isAbandoned   = false;
                break;
            }
            else
            {
                item.Selected = false;
            }
        }
        if (isAbandoned)
        {
            string description = SystemPara.getDescription(careerOpportunityInfo.Division);
            txtDivision.Items.Add(new ListItem(description, careerOpportunityInfo.Division.ToString()));
            txtDivision.Value = careerOpportunityInfo.Division.ToString();
        }
        /////---------------
        /////---------------3

        isAbandoned = true;
        foreach (ListItem item in txtDepartment.Items)
        {
            if (item.Value == careerOpportunityInfo.Department.ToString())
            {
                item.Selected = true;
                isAbandoned   = false;
                break;
            }
            else
            {
                item.Selected = false;
            }
        }
        if (isAbandoned)
        {
            string description = SystemPara.getDescription(careerOpportunityInfo.Department);
            txtDepartment.Items.Add(new ListItem(description, careerOpportunityInfo.Department.ToString()));
            txtDepartment.Value = careerOpportunityInfo.Department.ToString();
        }
        /////---------------


        /////---------------4

        isAbandoned = true;
        foreach (ListItem item in txtType.Items)
        {
            if (item.Value == careerOpportunityInfo.EmploymentType.ToString())
            {
                item.Selected = true;
                isAbandoned   = false;
                break;
            }
            else
            {
                item.Selected = false;
            }
        }
        if (isAbandoned)
        {
            string description = SystemPara.getDescription(careerOpportunityInfo.EmploymentType);
            txtType.Items.Add(new ListItem(description, careerOpportunityInfo.EmploymentType.ToString()));
            txtType.Value = careerOpportunityInfo.EmploymentType.ToString();
        }
        /////---------------

        //txtJobFunction.Value = careerOpportunityInfo.JobFunction;
        //txtDivision.Value = careerOpportunityInfo.Division;
        //txtDepartment.Value = careerOpportunityInfo.Department;
        txtLocation.Value = careerOpportunityInfo.Location;
        //txtType.Value = careerOpportunityInfo.EmploymentType;
        txtEmail.Value      = careerOpportunityInfo.Email;
        txtDetails.Value    = careerOpportunityInfo.Details;
        txtDisclaimer.Value = careerOpportunityInfo.Disclaimer;
    }
Exemplo n.º 8
0
    public System.Text.StringBuilder getLatestCareerOpportunitiesStr(int total)
    {
        List <CareerOpportunityInfo> latestCareerOpportunityList = this.getLatestCareerOpportunities(0);

        System.Text.StringBuilder careerOpportunities = new System.Text.StringBuilder();

        int lastDivision = 0;

        careerOpportunities.Append("<ul class='list'>");
        int count = 0;

        foreach (CareerOpportunityInfo careerOppty in latestCareerOpportunityList)
        {
            if (count == total && total != 0)
            {
                break;
            }
            if (lastDivision == 0)
            {
                careerOpportunities.Append("<li><a>");
                careerOpportunities.Append(SystemPara.getDescription(careerOppty.Division));
                //careerOpportunities.Append(careerOppty.Division);
                careerOpportunities.Append("</a>");
                careerOpportunities.Append("<ul class='margin20px'>");

                lastDivision = careerOppty.Division;
                count++;
            }
            else if (lastDivision != 0 && lastDivision != careerOppty.Division)
            {
                careerOpportunities.Append("</ul>");
                careerOpportunities.Append("</li>");
                careerOpportunities.Append("<li><a>");
                careerOpportunities.Append(SystemPara.getDescription(careerOppty.Division));
                careerOpportunities.Append("</a>");
                careerOpportunities.Append("<ul class='margin20px'>");

                lastDivision = careerOppty.Division;
                count++;
            }

            if (careerOppty.NewIconInfo != null)
            {
                careerOpportunities.Append("<li class='file newIcon'><a href=ViewCareer.aspx?ID=");
            }
            else
            {
                careerOpportunities.Append("<li class='file'><a href=ViewCareer.aspx?ID=");
            }
            careerOpportunities.Append(careerOppty.ID.ToString());
            careerOpportunities.Append(">");
            careerOpportunities.Append(SystemPara.getDescription(careerOppty.JobFunction));
            careerOpportunities.Append("</a>");
            careerOpportunities.Append("</li>");
        }

        careerOpportunities.Append("</ul>");
        careerOpportunities.Append("</li>");
        careerOpportunities.Append("</ul>");

        return(careerOpportunities);
    }
Exemplo n.º 9
0
    protected void initTraining(int ID)
    {
        hdfID.Value = ID.ToString();
        Event     eventHandler = new Event();
        EventInfo eventInfo    = eventHandler.getEvent(ID);

        txtVersionNo.InnerText = eventInfo.VersionNo.ToString("N");
        string[] serialNoArray = eventInfo.SerialNo.Split('-');

        txtSerialNo0.InnerText = serialNoArray[0] + "-" + serialNoArray[1];
        txtSerialNo1.Value     = serialNoArray[2];
        txtSerialNo2.Value     = serialNoArray[3];
        // comType.Value = eventInfo.Type;

        bool isAbandoned = true;

        foreach (ListItem item in comType.Items)
        {
            if (item.Value == eventInfo.Type.ToString())
            {
                item.Selected = true;
                isAbandoned   = false;
                break;
            }
            else
            {
                item.Selected = false;
            }
        }
        if (isAbandoned)
        {
            string description = SystemPara.getDescription(eventInfo.Type);
            comType.Items.Add(new ListItem(description, eventInfo.Type.ToString()));
            comType.Value = eventInfo.Type.ToString();
        }



        txtName.Value          = eventInfo.Name;
        txtContactPerson.Value = eventInfo.ContactPerson;
        txtDepartment.Value    = eventInfo.Department;


        txtEventDetails.Value = eventInfo.EventDetails;
        txtLocation.Value     = eventInfo.Location;
        txtPhoneNumber.Value  = eventInfo.PhoneNumber;

        dateStartDate.Value = eventInfo.StartTime.ToString("dd/MM/yyyy");
        dateStartTime.Value = eventInfo.StartTime.ToString("HH:mm");
        dateEndTime.Value   = eventInfo.EndTime.ToString("HH:mm");

        dateDeadline.Value = eventInfo.Deadline.ToString("dd/MM/yyyy");


        //new icon
        if (eventInfo.NewIconInfo != null)
        {
            txtIconExpiryDay.Value = eventInfo.NewIconInfo.ExpiryDate.ToString(GlobalSetting.DateTimeFormat);
        }


        this.isPublicHoliday = eventInfo.IsPublicHoliday();
        if (isPublicHoliday)
        {
            dateStartTime.Value = "";
            dateEndTime.Value   = "";
            dateDeadline.Value  = "";
        }
    }