Esempio n. 1
0
        protected void issueQueryBtn_Click(object sender, EventArgs e)
        {
            EmployeeQueryTableInfo objQuery = new EmployeeQueryTableInfo();

            objQuery.QueryReceivedBy = Convert.ToInt32(queryEmployeeList.SelectedValue);
            objQuery.QueryTitle      = txtQueryTitle.Text;
            objQuery.Description     = txtQueryDesc.Text;
            if (QueryFileUpload.HasFile)
            {
                string filepath = HttpContext.Current.Server.MapPath("~/QueryLetters/").ToString();
                QueryFileUpload.SaveAs(filepath + "\\" + QueryFileUpload.FileName.ToString());
                objQuery.QueryLetter = "~/QueryLetters/" + "/" + QueryFileUpload.FileName.ToString();
            }
            objQuery.IssueDate = DateTime.Now.ToString();

            // get the  user that login
            UserInfo objIssuedByUser = new UserInfo();

            objIssuedByUser        = (new UserController()).GetUser(0, UserId);
            objQuery.QueryIssuedBy = objIssuedByUser.UserID;

            int queryId = (new EmployeeQueryTableController()).AddQuery(objQuery);

            if (queryId > 0)
            {
                lblQueryIssueReport.Text = "Query send succesfully";
            }
            else
            {
                lblQueryIssueReport.Text = "Query fail";
            }
        }
Esempio n. 2
0
        protected void btnSendDisciplined_Click(object sender, EventArgs e)
        {
            EmployeeQueryTableInfo objQuery = new EmployeeQueryTableInfo();
            int QueryID = Convert.ToInt32(ViewState["queryId"]);

            objQuery.QueryID        = QueryID;
            objQuery.DisciplineDate = DateTime.Now.ToString();
            UserInfo objUser = new UserInfo();

            objUser = (new UserController()).GetUser(0, UserId);
            objQuery.DisciplinedBy      = objUser.UserID;
            objQuery.DisciplineDetails  = txtDisciplineDescription.Text;
            objQuery.DiscipliineType_FK = Convert.ToInt32(ddlDisciplineType.SelectedValue);
            if (DisciplinedLetterUpload.HasFile)
            {
                string filepath = HttpContext.Current.Server.MapPath("~/QueryLetters/").ToString();

                // lblDisciplineLetterName.Text = DisciplinedLetterUpload.FileName;
                DisciplinedLetterUpload.SaveAs(filepath + "\\" + DisciplinedLetterUpload.FileName.ToString());
                objQuery.DisciplineLetter = "~/QueryLetters/" + "/" + DisciplinedLetterUpload.FileName.ToString();
            }
            (new EmployeeQueryTableController()).UpdateQueryDiscipline(objQuery);
        }
Esempio n. 3
0
        protected void GVSupervisorQuery_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "View")
            {
                EmployeeQueryTableInfo objQuery = new EmployeeQueryTableInfo();
                objQuery = (new EmployeeQueryTableController()).Get(Convert.ToInt32(e.CommandArgument));
                int queryId = objQuery.QueryID;
                ViewState.Add("queryId", queryId);
                lblDisEmpNum.Text           = objQuery.EmployeeNum;
                lblDisQueryTitle.Text       = objQuery.QueryTitle;
                lblDisQueryDescription.Text = objQuery.Description;
                lblDisQueryIssueDay.Text    = objQuery.IssueDate;
                lblDisQueryResponse.Text    = objQuery.EmployeeResponse;
                lblDisResponseDate.Text     = objQuery.ResponseDate;

                UserInfo objUser = new UserInfo();
                objUser = (new UserController()).GetUser(0, UserId);
                lblDisciplineBy.Text   = objUser.LastName + " " + objUser.FirstName;
                lblDisciplineDate.Text = DateTime.Now.ToString();

                ArrayList DisciplineType = new ArrayList();
                DisciplineType = new EmployeeDisciplineTableController().List();
                if (DisciplineType.Count > 0)
                {
                    ddlDisciplineType.DataSource     = DisciplineType;
                    ddlDisciplineType.DataValueField = "DisciplineID";
                    ddlDisciplineType.DataTextField  = "DiscplineDescription";
                    ddlDisciplineType.DataBind();
                    ddlDisciplineType.Visible = true;
                }
                ddlDisciplineType.Items.Insert(0, new ListItem("***Please select***", "-1"));
                lblDisciplineDate.Text  = DateTime.Now.ToString();
                PanelDiscipline.Visible = true;
                PanelQuery.Visible      = false;
            }
        }