コード例 #1
0
        public List <DepartmentMonthlyInformation> GetListDepartmentMonthlyInformation(int departmentID)
        {
            List <DepartmentMonthlyInformation> listDepartmentMonthlyInformation = new List <DepartmentMonthlyInformation>()
            {
            };

            SqlParameter[] parametersDepartment = new SqlParameter[]
            {
                new SqlParameter("@DepartmentID", departmentID)
            };

            //Lets get the list of DepartmentMonthlyInformation records from database
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("DepartmentMonthlyInformation_GetList_UseInDepartment", CommandType.StoredProcedure, parametersDepartment))
            {
                //check if any record exists or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of departmentMonthlyInformation
                    listDepartmentMonthlyInformation = new List <DepartmentMonthlyInformation>();

                    //Now lets populate the DepartmentMonthlyInformation details into the list of departmentMonthlyInformations
                    foreach (DataRow row in table.Rows)
                    {
                        DepartmentMonthlyInformation departmentMonthlyInformation = ConvertRowToDepartmentMonthlyInformation(row);
                        listDepartmentMonthlyInformation.Add(departmentMonthlyInformation);
                    }
                }
            }

            return(listDepartmentMonthlyInformation);
        }
コード例 #2
0
        public List <DepartmentMonthlyInformation> GetListDepartmentMonthlyInformation(int adjutancyTypeID)
        {
            List <DepartmentMonthlyInformation> listDepartmentMonthlyInformation = new List <DepartmentMonthlyInformation>()
            {
            };

            SqlParameter[] parametersAdjutancyType = new SqlParameter[]
            {
                new SqlParameter("@AdjutancyTypeID", adjutancyTypeID)
            };

            //Lets get the list of DepartmentMonthlyInformation records from database
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("AdjutancyType_GetList_DepartmentMonthlyInformation", CommandType.StoredProcedure, parametersAdjutancyType))
            {
                //check if any record exists or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of DepartmentMonthlyInformation
                    listDepartmentMonthlyInformation = new List <DepartmentMonthlyInformation>();

                    //Now lets populate the DepartmentMonthlyInformation details into the list of DepartmentMonthlyInformations
                    foreach (DataRow row in table.Rows)
                    {
                        DepartmentMonthlyInformation departmentMonthlyInformation = departmentMonthlyInformationDBAccess.GetDetails(Convert.ToInt32(row["YearTypeID"]), Convert.ToInt32(row["MonthTypeID"]), Convert.ToInt32(row["DepartmentID"]));
                        listDepartmentMonthlyInformation.Add(departmentMonthlyInformation);
                    }
                }
            }

            return(listDepartmentMonthlyInformation);
        }
コード例 #3
0
    protected void btnYES_Click(object sender, EventArgs e)
    {
        DepartmentMonthlyInformation departmentMonthlyInformation = new DepartmentMonthlyInformation();

        departmentMonthlyInformation.YearTypeID                     = Convert.ToInt32(ddlYearTypeID.SelectedValue);
        departmentMonthlyInformation.MonthTypeID                    = Convert.ToInt32(ddlMonthTypeID.SelectedValue);
        departmentMonthlyInformation.DepartmentID                   = Convert.ToInt32(ddlDepartmentID.SelectedValue);
        departmentMonthlyInformation.RewardPerEmployee              = Convert.ToInt64(txtRewardPerEmployee.Text);
        departmentMonthlyInformation.OperationalRewardCalculated    = Convert.ToInt64(txtOperationalRewardCalculated.Text);
        departmentMonthlyInformation.OperationalReward              = Convert.ToInt64(txtOperationalReward.Text);
        departmentMonthlyInformation.OrganizationalRewardCalculated = Convert.ToInt64(txtOrganizationalRewardCalculated.Text);
        departmentMonthlyInformation.OrganizationalReward           = Convert.ToInt64(txtOrganizationalReward.Text);
        departmentMonthlyInformation.MonthlyProceed                 = Convert.ToInt64(txtMonthlyProceed.Text);
        departmentMonthlyInformation.DesiredMonthlyProceed          = Convert.ToInt64(txtDesiredMonthlyProceed.Text);
        departmentMonthlyInformation.LastYearProceed                = Convert.ToInt64(txtLastYearProceed.Text);
        departmentMonthlyInformation.DossierNumber                  = Convert.ToInt32(txtDossierNumber.Text);
        departmentMonthlyInformation.Value3                    = Convert.ToInt32(txtValue3.Text);
        departmentMonthlyInformation.Value4                    = Convert.ToInt32(txtValue4.Text);
        departmentMonthlyInformation.Value5                    = Convert.ToInt32(txtValue5.Text);
        departmentMonthlyInformation.Value6                    = Convert.ToInt32(txtValue6.Text);
        departmentMonthlyInformation.EmployeeNumber            = Convert.ToInt32(txtEmployeeNumber.Text);
        departmentMonthlyInformation.ContractualEmployeeNumber = Convert.ToInt32(txtContractualEmployeeNumber.Text);

        DepartmentMonthlyInformationHandler departmentMonthlyInformationHandler = new DepartmentMonthlyInformationHandler();

        if (departmentMonthlyInformationHandler.Insert(departmentMonthlyInformation) > 0)
        {
            Response.Redirect("Z_DepartmentMonthlyInformationDefault.aspx");
        }
    }
コード例 #4
0
        private DepartmentMonthlyInformation ConvertRowToDepartmentMonthlyInformation(DataRow row)
        {
            DepartmentMonthlyInformation departmentMonthlyInformation = new DepartmentMonthlyInformation();

            departmentMonthlyInformation.YearTypeID                             = (row["YearTypeID"] != DBNull.Value) ? Convert.ToInt32(row["YearTypeID"]) : 0;
            departmentMonthlyInformation.MonthTypeID                            = (row["MonthTypeID"] != DBNull.Value) ? Convert.ToInt32(row["MonthTypeID"]) : 0;
            departmentMonthlyInformation.DepartmentID                           = (row["DepartmentID"] != DBNull.Value) ? Convert.ToInt32(row["DepartmentID"]) : 0;
            departmentMonthlyInformation.AdjutancyTypeID                        = (row["AdjutancyTypeID"] != DBNull.Value) ? Convert.ToInt32(row["AdjutancyTypeID"]) : 0;
            departmentMonthlyInformation.Value1                                 = (row["Value1"] != DBNull.Value) ? Convert.ToSingle(row["Value1"]) : 0;
            departmentMonthlyInformation.OperationalReward_Average              = (row["OperationalReward_Average"] != DBNull.Value) ? Convert.ToSingle(row["OperationalReward_Average"]) : 0;
            departmentMonthlyInformation.OperationalRewardAverage               = (row["OperationalRewardAverage"] != DBNull.Value) ? Convert.ToSingle(row["OperationalRewardAverage"]) : 0;
            departmentMonthlyInformation.Value2                                 = (row["Value2"] != DBNull.Value) ? Convert.ToDecimal(row["Value2"]) : 0;
            departmentMonthlyInformation.OperationalScore                       = (row["OperationalScore"] != DBNull.Value) ? Convert.ToDecimal(row["OperationalScore"]) : 0;
            departmentMonthlyInformation.TotalParameter1                        = (row["TotalParameter1"] != DBNull.Value) ? Convert.ToDecimal(row["TotalParameter1"]) : 0;
            departmentMonthlyInformation.TotalParameter2                        = (row["TotalParameter2"] != DBNull.Value) ? Convert.ToDecimal(row["TotalParameter2"]) : 0;
            departmentMonthlyInformation.TotalParameter3                        = (row["TotalParameter3"] != DBNull.Value) ? Convert.ToDecimal(row["TotalParameter3"]) : 0;
            departmentMonthlyInformation.TotalBossFactor                        = (row["TotalBossFactor"] != DBNull.Value) ? Convert.ToDecimal(row["TotalBossFactor"]) : 0;
            departmentMonthlyInformation.TotalReward_                           = (row["TotalReward_"] != DBNull.Value) ? Convert.ToInt64(row["TotalReward_"]) : 0;
            departmentMonthlyInformation.OrganizationalReward_                  = (row["OrganizationalReward_"] != DBNull.Value) ? Convert.ToInt64(row["OrganizationalReward_"]) : 0;
            departmentMonthlyInformation.OperationalReward_                     = (row["OperationalReward_"] != DBNull.Value) ? Convert.ToInt64(row["OperationalReward_"]) : 0;
            departmentMonthlyInformation.TotalReward_Average                    = (row["TotalReward_Average"] != DBNull.Value) ? Convert.ToInt64(row["TotalReward_Average"]) : 0;
            departmentMonthlyInformation.YearTypeIDTitle                        = row["YearTypeIDTitle"].ToString();
            departmentMonthlyInformation.MonthTypeIDTitle                       = row["MonthTypeIDTitle"].ToString();
            departmentMonthlyInformation.DepartmentIDTitle                      = row["DepartmentIDTitle"].ToString();
            departmentMonthlyInformation.RewardPerEmployee                      = (row["RewardPerEmployee"] != DBNull.Value) ? Convert.ToInt64(row["RewardPerEmployee"]) : 0;
            departmentMonthlyInformation.OperationalRewardCalculated            = (row["OperationalRewardCalculated"] != DBNull.Value) ? Convert.ToInt64(row["OperationalRewardCalculated"]) : 0;
            departmentMonthlyInformation.OperationalReward                      = (row["OperationalReward"] != DBNull.Value) ? Convert.ToInt64(row["OperationalReward"]) : 0;
            departmentMonthlyInformation.OrganizationalRewardCalculated         = (row["OrganizationalRewardCalculated"] != DBNull.Value) ? Convert.ToInt64(row["OrganizationalRewardCalculated"]) : 0;
            departmentMonthlyInformation.OrganizationalReward                   = (row["OrganizationalReward"] != DBNull.Value) ? Convert.ToInt64(row["OrganizationalReward"]) : 0;
            departmentMonthlyInformation.MonthlyProceed                         = (row["MonthlyProceed"] != DBNull.Value) ? Convert.ToInt64(row["MonthlyProceed"]) : 0;
            departmentMonthlyInformation.DesiredMonthlyProceed                  = (row["DesiredMonthlyProceed"] != DBNull.Value) ? Convert.ToInt64(row["DesiredMonthlyProceed"]) : 0;
            departmentMonthlyInformation.LastYearProceed                        = (row["LastYearProceed"] != DBNull.Value) ? Convert.ToInt64(row["LastYearProceed"]) : 0;
            departmentMonthlyInformation.StatisticsFinalalization               = (row["StatisticsFinalalization"] != DBNull.Value) ? Convert.ToBoolean((row["StatisticsFinalalization"].ToString() == "1" || row["StatisticsFinalalization"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.AssistantRewardsFinalization           = (row["AssistantRewardsFinalization"] != DBNull.Value) ? Convert.ToBoolean((row["AssistantRewardsFinalization"].ToString() == "1" || row["AssistantRewardsFinalization"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.ManagerRewardsFinalization             = (row["ManagerRewardsFinalization"] != DBNull.Value) ? Convert.ToBoolean((row["ManagerRewardsFinalization"].ToString() == "1" || row["ManagerRewardsFinalization"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.IsOfficialRewardsFinalizedBoss         = (row["IsOfficialRewardsFinalizedBoss"] != DBNull.Value) ? Convert.ToBoolean((row["IsOfficialRewardsFinalizedBoss"].ToString() == "1" || row["IsOfficialRewardsFinalizedBoss"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.IsOfficialRewardsFinalizedAssistant    = (row["IsOfficialRewardsFinalizedAssistant"] != DBNull.Value) ? Convert.ToBoolean((row["IsOfficialRewardsFinalizedAssistant"].ToString() == "1" || row["IsOfficialRewardsFinalizedAssistant"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.IsOfficialRewardsFinalizedManager      = (row["IsOfficialRewardsFinalizedManager"] != DBNull.Value) ? Convert.ToBoolean((row["IsOfficialRewardsFinalizedManager"].ToString() == "1" || row["IsOfficialRewardsFinalizedManager"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.ContractualRewardsFinalization         = (row["ContractualRewardsFinalization"] != DBNull.Value) ? Convert.ToBoolean((row["ContractualRewardsFinalization"].ToString() == "1" || row["ContractualRewardsFinalization"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.IsContractualRewardsFinalizedBoss      = (row["IsContractualRewardsFinalizedBoss"] != DBNull.Value) ? Convert.ToBoolean((row["IsContractualRewardsFinalizedBoss"].ToString() == "1" || row["IsContractualRewardsFinalizedBoss"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.IsContractualRewardsFinalizedAssistant = (row["IsContractualRewardsFinalizedAssistant"] != DBNull.Value) ? Convert.ToBoolean((row["IsContractualRewardsFinalizedAssistant"].ToString() == "1" || row["IsContractualRewardsFinalizedAssistant"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.IsContractualRewardsFinalizedManager   = (row["IsContractualRewardsFinalizedManager"] != DBNull.Value) ? Convert.ToBoolean((row["IsContractualRewardsFinalizedManager"].ToString() == "1" || row["IsContractualRewardsFinalizedManager"].ToString().ToLower() == "true") ? true : false) : false;
            departmentMonthlyInformation.DossierNumber                          = (row["DossierNumber"] != DBNull.Value) ? Convert.ToInt32(row["DossierNumber"]) : 0;
            departmentMonthlyInformation.Value3                                 = (row["Value3"] != DBNull.Value) ? Convert.ToInt32(row["Value3"]) : 0;
            departmentMonthlyInformation.Value4                                 = (row["Value4"] != DBNull.Value) ? Convert.ToInt32(row["Value4"]) : 0;
            departmentMonthlyInformation.Value5                                 = (row["Value5"] != DBNull.Value) ? Convert.ToInt32(row["Value5"]) : 0;
            departmentMonthlyInformation.Value6                                 = (row["Value6"] != DBNull.Value) ? Convert.ToInt32(row["Value6"]) : 0;
            departmentMonthlyInformation.EmployeeNumber                         = (row["EmployeeNumber"] != DBNull.Value) ? Convert.ToInt32(row["EmployeeNumber"]) : 0;
            departmentMonthlyInformation.ContractualEmployeeNumber              = (row["ContractualEmployeeNumber"] != DBNull.Value) ? Convert.ToInt32(row["ContractualEmployeeNumber"]) : 0;
            return(departmentMonthlyInformation);
        }
コード例 #5
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Label   lblYearTypeID                             = GridView1.Rows[e.RowIndex].FindControl("lblYearTypeID") as Label;
        Label   lblMonthTypeID                            = GridView1.Rows[e.RowIndex].FindControl("lblMonthTypeID") as Label;
        Label   lblDepartmentID                           = GridView1.Rows[e.RowIndex].FindControl("lblDepartmentID") as Label;
        Label   lblAdjutancyTypeID                        = GridView1.Rows[e.RowIndex].FindControl("lblAdjutancyTypeID") as Label;
        Label   lblValue1                                 = GridView1.Rows[e.RowIndex].FindControl("lblValue1") as Label;
        Label   lblOperationalReward_Average              = GridView1.Rows[e.RowIndex].FindControl("lblOperationalReward_Average") as Label;
        Label   lblOperationalRewardAverage               = GridView1.Rows[e.RowIndex].FindControl("lblOperationalRewardAverage") as Label;
        Label   lblValue2                                 = GridView1.Rows[e.RowIndex].FindControl("lblValue2") as Label;
        Label   lblOperationalScore                       = GridView1.Rows[e.RowIndex].FindControl("lblOperationalScore") as Label;
        Label   lblTotalParameter1                        = GridView1.Rows[e.RowIndex].FindControl("lblTotalParameter1") as Label;
        Label   lblTotalParameter2                        = GridView1.Rows[e.RowIndex].FindControl("lblTotalParameter2") as Label;
        Label   lblTotalParameter3                        = GridView1.Rows[e.RowIndex].FindControl("lblTotalParameter3") as Label;
        Label   lblTotalBossFactor                        = GridView1.Rows[e.RowIndex].FindControl("lblTotalBossFactor") as Label;
        Label   lblTotalReward_                           = GridView1.Rows[e.RowIndex].FindControl("lblTotalReward_") as Label;
        Label   lblOrganizationalReward_                  = GridView1.Rows[e.RowIndex].FindControl("lblOrganizationalReward_") as Label;
        Label   lblOperationalReward_                     = GridView1.Rows[e.RowIndex].FindControl("lblOperationalReward_") as Label;
        Label   lblTotalReward_Average                    = GridView1.Rows[e.RowIndex].FindControl("lblTotalReward_Average") as Label;
        Label   lblYearTypeIDTitle                        = GridView1.Rows[e.RowIndex].FindControl("lblYearTypeIDTitle") as Label;
        Label   lblMonthTypeIDTitle                       = GridView1.Rows[e.RowIndex].FindControl("lblMonthTypeIDTitle") as Label;
        Label   lblDepartmentIDTitle                      = GridView1.Rows[e.RowIndex].FindControl("lblDepartmentIDTitle") as Label;
        TextBox txtRewardPerEmployee                      = GridView1.Rows[e.RowIndex].FindControl("txtRewardPerEmployee") as TextBox;
        TextBox txtOperationalRewardCalculated            = GridView1.Rows[e.RowIndex].FindControl("txtOperationalRewardCalculated") as TextBox;
        TextBox txtOperationalReward                      = GridView1.Rows[e.RowIndex].FindControl("txtOperationalReward") as TextBox;
        TextBox txtOrganizationalRewardCalculated         = GridView1.Rows[e.RowIndex].FindControl("txtOrganizationalRewardCalculated") as TextBox;
        TextBox txtOrganizationalReward                   = GridView1.Rows[e.RowIndex].FindControl("txtOrganizationalReward") as TextBox;
        TextBox txtMonthlyProceed                         = GridView1.Rows[e.RowIndex].FindControl("txtMonthlyProceed") as TextBox;
        TextBox txtDesiredMonthlyProceed                  = GridView1.Rows[e.RowIndex].FindControl("txtDesiredMonthlyProceed") as TextBox;
        TextBox txtLastYearProceed                        = GridView1.Rows[e.RowIndex].FindControl("txtLastYearProceed") as TextBox;
        TextBox txtStatisticsFinalalization               = GridView1.Rows[e.RowIndex].FindControl("txtStatisticsFinalalization") as TextBox;
        TextBox txtAssistantRewardsFinalization           = GridView1.Rows[e.RowIndex].FindControl("txtAssistantRewardsFinalization") as TextBox;
        TextBox txtManagerRewardsFinalization             = GridView1.Rows[e.RowIndex].FindControl("txtManagerRewardsFinalization") as TextBox;
        TextBox txtIsOfficialRewardsFinalizedBoss         = GridView1.Rows[e.RowIndex].FindControl("txtIsOfficialRewardsFinalizedBoss") as TextBox;
        TextBox txtIsOfficialRewardsFinalizedAssistant    = GridView1.Rows[e.RowIndex].FindControl("txtIsOfficialRewardsFinalizedAssistant") as TextBox;
        TextBox txtIsOfficialRewardsFinalizedManager      = GridView1.Rows[e.RowIndex].FindControl("txtIsOfficialRewardsFinalizedManager") as TextBox;
        TextBox txtContractualRewardsFinalization         = GridView1.Rows[e.RowIndex].FindControl("txtContractualRewardsFinalization") as TextBox;
        TextBox txtIsContractualRewardsFinalizedBoss      = GridView1.Rows[e.RowIndex].FindControl("txtIsContractualRewardsFinalizedBoss") as TextBox;
        TextBox txtIsContractualRewardsFinalizedAssistant = GridView1.Rows[e.RowIndex].FindControl("txtIsContractualRewardsFinalizedAssistant") as TextBox;
        TextBox txtIsContractualRewardsFinalizedManager   = GridView1.Rows[e.RowIndex].FindControl("txtIsContractualRewardsFinalizedManager") as TextBox;
        TextBox txtDossierNumber                          = GridView1.Rows[e.RowIndex].FindControl("txtDossierNumber") as TextBox;
        TextBox txtValue3                                 = GridView1.Rows[e.RowIndex].FindControl("txtValue3") as TextBox;
        TextBox txtValue4                                 = GridView1.Rows[e.RowIndex].FindControl("txtValue4") as TextBox;
        TextBox txtValue5                                 = GridView1.Rows[e.RowIndex].FindControl("txtValue5") as TextBox;
        TextBox txtValue6                                 = GridView1.Rows[e.RowIndex].FindControl("txtValue6") as TextBox;
        TextBox txtEmployeeNumber                         = GridView1.Rows[e.RowIndex].FindControl("txtEmployeeNumber") as TextBox;
        TextBox txtContractualEmployeeNumber              = GridView1.Rows[e.RowIndex].FindControl("txtContractualEmployeeNumber") as TextBox;


        if (lblYearTypeID != null && lblMonthTypeID != null && lblDepartmentID != null && lblAdjutancyTypeID != null && lblValue1 != null && lblOperationalReward_Average != null && lblOperationalRewardAverage != null && lblValue2 != null && lblOperationalScore != null && lblTotalParameter1 != null && lblTotalParameter2 != null && lblTotalParameter3 != null && lblTotalBossFactor != null && lblTotalReward_ != null && lblOrganizationalReward_ != null && lblOperationalReward_ != null && lblTotalReward_Average != null && lblYearTypeIDTitle != null && lblMonthTypeIDTitle != null && lblDepartmentIDTitle != null && txtRewardPerEmployee != null && txtOperationalRewardCalculated != null && txtOperationalReward != null && txtOrganizationalRewardCalculated != null && txtOrganizationalReward != null && txtMonthlyProceed != null && txtDesiredMonthlyProceed != null && txtLastYearProceed != null && txtStatisticsFinalalization != null && txtAssistantRewardsFinalization != null && txtManagerRewardsFinalization != null && txtIsOfficialRewardsFinalizedBoss != null && txtIsOfficialRewardsFinalizedAssistant != null && txtIsOfficialRewardsFinalizedManager != null && txtContractualRewardsFinalization != null && txtIsContractualRewardsFinalizedBoss != null && txtIsContractualRewardsFinalizedAssistant != null && txtIsContractualRewardsFinalizedManager != null && txtDossierNumber != null && txtValue3 != null && txtValue4 != null && txtValue5 != null && txtValue6 != null && txtEmployeeNumber != null && txtContractualEmployeeNumber != null)
        {
            DepartmentMonthlyInformation departmentMonthlyInformation = new DepartmentMonthlyInformation();

            departmentMonthlyInformation.YearTypeID                     = Convert.ToInt32(lblYearTypeID.Text.Trim());
            departmentMonthlyInformation.MonthTypeID                    = Convert.ToInt32(lblMonthTypeID.Text.Trim());
            departmentMonthlyInformation.DepartmentID                   = Convert.ToInt32(lblDepartmentID.Text.Trim());
            departmentMonthlyInformation.AdjutancyTypeID                = Convert.ToInt32(lblAdjutancyTypeID.Text.Trim());
            departmentMonthlyInformation.TotalReward_                   = Convert.ToInt64(lblTotalReward_.Text.Trim());
            departmentMonthlyInformation.OrganizationalReward_          = Convert.ToInt64(lblOrganizationalReward_.Text.Trim());
            departmentMonthlyInformation.OperationalReward_             = Convert.ToInt64(lblOperationalReward_.Text.Trim());
            departmentMonthlyInformation.TotalReward_Average            = Convert.ToInt64(lblTotalReward_Average.Text.Trim());
            departmentMonthlyInformation.YearTypeIDTitle                = lblYearTypeIDTitle.Text;
            departmentMonthlyInformation.MonthTypeIDTitle               = lblMonthTypeIDTitle.Text;
            departmentMonthlyInformation.DepartmentIDTitle              = lblDepartmentIDTitle.Text;
            departmentMonthlyInformation.RewardPerEmployee              = Convert.ToInt64(txtRewardPerEmployee.Text.Trim());
            departmentMonthlyInformation.OperationalRewardCalculated    = Convert.ToInt64(txtOperationalRewardCalculated.Text.Trim());
            departmentMonthlyInformation.OperationalReward              = Convert.ToInt64(txtOperationalReward.Text.Trim());
            departmentMonthlyInformation.OrganizationalRewardCalculated = Convert.ToInt64(txtOrganizationalRewardCalculated.Text.Trim());
            departmentMonthlyInformation.OrganizationalReward           = Convert.ToInt64(txtOrganizationalReward.Text.Trim());
            departmentMonthlyInformation.MonthlyProceed                 = Convert.ToInt64(txtMonthlyProceed.Text.Trim());
            departmentMonthlyInformation.DesiredMonthlyProceed          = Convert.ToInt64(txtDesiredMonthlyProceed.Text.Trim());
            departmentMonthlyInformation.LastYearProceed                = Convert.ToInt64(txtLastYearProceed.Text.Trim());
            departmentMonthlyInformation.DossierNumber                  = Convert.ToInt32(txtDossierNumber.Text.Trim());
            departmentMonthlyInformation.Value3                    = Convert.ToInt32(txtValue3.Text.Trim());
            departmentMonthlyInformation.Value4                    = Convert.ToInt32(txtValue4.Text.Trim());
            departmentMonthlyInformation.Value5                    = Convert.ToInt32(txtValue5.Text.Trim());
            departmentMonthlyInformation.Value6                    = Convert.ToInt32(txtValue6.Text.Trim());
            departmentMonthlyInformation.EmployeeNumber            = Convert.ToInt32(txtEmployeeNumber.Text.Trim());
            departmentMonthlyInformation.ContractualEmployeeNumber = Convert.ToInt32(txtContractualEmployeeNumber.Text.Trim());

            //Let us now update the database
            if (departmentMonthlyInformationHandler.Update(departmentMonthlyInformation) == true)
            {
                lblResult.Text = "Record Updated Successfully";
            }
            else
            {
                lblResult.Text = "Failed to Update record";
            }

            //end the editing and bind with updated records.
            GridView1.EditIndex = -1;
            BindData();
        }
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string yearTypeID   = Request.QueryString["yearTypeID"] as string;
        string monthTypeID  = Request.QueryString["monthTypeID"] as string;
        string departmentID = Request.QueryString["departmentID"] as string;

        if (yearTypeID == null || monthTypeID == null || departmentID == null)
        {
            Response.Redirect("Z_DepartmentMonthlyInformationDefault.aspx");
        }

        try
        {
            departmentMonthlyInformationYearTypeID   = Convert.ToInt32(yearTypeID.Trim());
            departmentMonthlyInformationMonthTypeID  = Convert.ToInt32(monthTypeID.Trim());
            departmentMonthlyInformationDepartmentID = Convert.ToInt32(departmentID.Trim());
            departmentMonthlyInformationHandler      = new DepartmentMonthlyInformationHandler();

            DepartmentMonthlyInformation departmentMonthlyInformation = departmentMonthlyInformationHandler.GetDetails(departmentMonthlyInformationYearTypeID, departmentMonthlyInformationMonthTypeID, departmentMonthlyInformationDepartmentID);

            lblYearTypeID.Text                             = departmentMonthlyInformation.YearTypeID.ToString();
            lblMonthTypeID.Text                            = departmentMonthlyInformation.MonthTypeID.ToString();
            lblDepartmentID.Text                           = departmentMonthlyInformation.DepartmentID.ToString();
            lblAdjutancyTypeID.Text                        = departmentMonthlyInformation.AdjutancyTypeID.ToString();
            lblValue1.Text                                 = departmentMonthlyInformation.Value1.ToString();
            lblOperationalReward_Average.Text              = departmentMonthlyInformation.OperationalReward_Average.ToString();
            lblOperationalRewardAverage.Text               = departmentMonthlyInformation.OperationalRewardAverage.ToString();
            lblValue2.Text                                 = departmentMonthlyInformation.Value2.ToString();
            lblOperationalScore.Text                       = departmentMonthlyInformation.OperationalScore.ToString();
            lblTotalParameter1.Text                        = departmentMonthlyInformation.TotalParameter1.ToString();
            lblTotalParameter2.Text                        = departmentMonthlyInformation.TotalParameter2.ToString();
            lblTotalParameter3.Text                        = departmentMonthlyInformation.TotalParameter3.ToString();
            lblTotalBossFactor.Text                        = departmentMonthlyInformation.TotalBossFactor.ToString();
            lblTotalReward_.Text                           = departmentMonthlyInformation.TotalReward_.ToString();
            lblOrganizationalReward_.Text                  = departmentMonthlyInformation.OrganizationalReward_.ToString();
            lblOperationalReward_.Text                     = departmentMonthlyInformation.OperationalReward_.ToString();
            lblTotalReward_Average.Text                    = departmentMonthlyInformation.TotalReward_Average.ToString();
            lblYearTypeIDTitle.Text                        = departmentMonthlyInformation.YearTypeIDTitle.ToString();
            lblMonthTypeIDTitle.Text                       = departmentMonthlyInformation.MonthTypeIDTitle.ToString();
            lblDepartmentIDTitle.Text                      = departmentMonthlyInformation.DepartmentIDTitle.ToString();
            lblRewardPerEmployee.Text                      = departmentMonthlyInformation.RewardPerEmployee.ToString();
            lblOperationalRewardCalculated.Text            = departmentMonthlyInformation.OperationalRewardCalculated.ToString();
            lblOperationalReward.Text                      = departmentMonthlyInformation.OperationalReward.ToString();
            lblOrganizationalRewardCalculated.Text         = departmentMonthlyInformation.OrganizationalRewardCalculated.ToString();
            lblOrganizationalReward.Text                   = departmentMonthlyInformation.OrganizationalReward.ToString();
            lblMonthlyProceed.Text                         = departmentMonthlyInformation.MonthlyProceed.ToString();
            lblDesiredMonthlyProceed.Text                  = departmentMonthlyInformation.DesiredMonthlyProceed.ToString();
            lblLastYearProceed.Text                        = departmentMonthlyInformation.LastYearProceed.ToString();
            lblStatisticsFinalalization.Text               = departmentMonthlyInformation.StatisticsFinalalization.ToString();
            lblAssistantRewardsFinalization.Text           = departmentMonthlyInformation.AssistantRewardsFinalization.ToString();
            lblManagerRewardsFinalization.Text             = departmentMonthlyInformation.ManagerRewardsFinalization.ToString();
            lblIsOfficialRewardsFinalizedBoss.Text         = departmentMonthlyInformation.IsOfficialRewardsFinalizedBoss.ToString();
            lblIsOfficialRewardsFinalizedAssistant.Text    = departmentMonthlyInformation.IsOfficialRewardsFinalizedAssistant.ToString();
            lblIsOfficialRewardsFinalizedManager.Text      = departmentMonthlyInformation.IsOfficialRewardsFinalizedManager.ToString();
            lblContractualRewardsFinalization.Text         = departmentMonthlyInformation.ContractualRewardsFinalization.ToString();
            lblIsContractualRewardsFinalizedBoss.Text      = departmentMonthlyInformation.IsContractualRewardsFinalizedBoss.ToString();
            lblIsContractualRewardsFinalizedAssistant.Text = departmentMonthlyInformation.IsContractualRewardsFinalizedAssistant.ToString();
            lblIsContractualRewardsFinalizedManager.Text   = departmentMonthlyInformation.IsContractualRewardsFinalizedManager.ToString();
            lblDossierNumber.Text                          = departmentMonthlyInformation.DossierNumber.ToString();
            lblValue3.Text                                 = departmentMonthlyInformation.Value3.ToString();
            lblValue4.Text                                 = departmentMonthlyInformation.Value4.ToString();
            lblValue5.Text                                 = departmentMonthlyInformation.Value5.ToString();
            lblValue6.Text                                 = departmentMonthlyInformation.Value6.ToString();
            lblEmployeeNumber.Text                         = departmentMonthlyInformation.EmployeeNumber.ToString();
            lblContractualEmployeeNumber.Text              = departmentMonthlyInformation.ContractualEmployeeNumber.ToString();
        }
        catch (Exception)
        {
            Response.Redirect("Z_DepartmentMonthlyInformationDefault.aspx");
        }
    }