예제 #1
0
        protected void ddlArea_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlArea.SelectedValue == "-Select-")
                {
                    txtcode.Focus();
                    txtcode.Text        = string.Empty;
                    txtDescription.Text = string.Empty;
                    BtnSubmit.Visible   = true;
                    BtnUpdate.Visible   = false;
                }


                if (ddlArea.SelectedValue != "-Select-")
                {
                    Int16      MainCode = Converter.GetSmallInteger(ddlArea.SelectedValue);
                    A2ZAREADTO getDTO   = (A2ZAREADTO.GetInformation(MainCode));
                    if (getDTO.AreaCode > 0)
                    {
                        txtcode.Text        = Converter.GetString(getDTO.AreaCode);
                        txtDescription.Text = Converter.GetString(getDTO.AreaDescription);
                        BtnSubmit.Visible   = false;
                        BtnUpdate.Visible   = true;
                        txtDescription.Focus();
                    }
                    else
                    {
                        txtcode.Focus();
                        txtcode.Text        = string.Empty;
                        txtDescription.Text = string.Empty;
                        BtnSubmit.Visible   = true;
                        BtnUpdate.Visible   = false;
                    }
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.ddlArea_SelectedIndexChanged Problem');</script>");
                //throw ex;
            }
        }
예제 #2
0
        protected void btnSumbit_Click(object sender, EventArgs e)
        {
            try
            {
                int            EmpID  = Converter.GetInteger(txtEmpNo.Text);
                A2ZEMPLOYEEDTO getDTO = (A2ZEMPLOYEEDTO.GetInformation(EmpID));
                if (getDTO.EmployeeID > 0)
                {
                    txtEmpNo.ReadOnly = true;
                    txtNewPromotionDate.Focus();
                    lblName.Text = Converter.GetString(getDTO.EmployeeName);

                    int            Area    = Converter.GetInteger(getDTO.EmpArea);
                    A2ZDISTRICTDTO get1DTO = (A2ZDISTRICTDTO.GetInfo(Area));
                    if (get1DTO.DistrictCode > 0)
                    {
                        lblLastAreaCode.Text     = Converter.GetString(get1DTO.DistrictOrgCode);
                        lblLastArea.Text         = Converter.GetString(get1DTO.DistrictDescription);
                        ddlNewArea.SelectedValue = Converter.GetString(get1DTO.DistrictOrgCode);
                    }

                    int        Location = Converter.GetInteger(getDTO.EmpLocation);
                    A2ZAREADTO get7DTO  = (A2ZAREADTO.GetInformation(Location));
                    if (get7DTO.AreaCode > 0)
                    {
                        lblLastLocationCode.Text     = Converter.GetString(get7DTO.AreaCode);
                        lblLastLocation.Text         = Converter.GetString(get7DTO.AreaDescription);
                        ddlNewLocation.SelectedValue = Converter.GetString(get7DTO.AreaCode);
                    }

                    Int16         Section = Converter.GetSmallInteger(getDTO.EmpSection);
                    A2ZSECTIONDTO get2DTO = (A2ZSECTIONDTO.GetInformation(Section));
                    if (get2DTO.SectionCode > 0)
                    {
                        lblLastSectionCode.Text     = Converter.GetString(get2DTO.SectionCode);
                        lblLastSection.Text         = Converter.GetString(get2DTO.SectionName);
                        ddlNewSection.SelectedValue = Converter.GetString(get2DTO.SectionCode);
                    }

                    Int16            Department = Converter.GetSmallInteger(getDTO.EmpDepartment);
                    A2ZDEPARTMENTDTO get3DTO    = (A2ZDEPARTMENTDTO.GetInformation(Department));
                    if (get3DTO.DepartmentCode > 0)
                    {
                        lblLastDepartmentCode.Text     = Converter.GetString(get3DTO.DepartmentCode);
                        lblLastDepartment.Text         = Converter.GetString(get3DTO.DepartmentName);
                        ddlNewDepartment.SelectedValue = Converter.GetString(get3DTO.DepartmentCode);
                    }

                    Int16             Desig   = Converter.GetSmallInteger(getDTO.EmpDesignation);
                    A2ZDESIGNATIONDTO get4DTO = (A2ZDESIGNATIONDTO.GetInformation(Desig));
                    if (get4DTO.DesignationCode > 0)
                    {
                        lblLastDesignationCode.Text     = Converter.GetString(get4DTO.DesignationCode);
                        lblLastDesignation.Text         = Converter.GetString(get4DTO.DesignationDescription);
                        ddlNewDesignation.SelectedValue = Converter.GetString(get4DTO.DesignationCode);
                    }

                    lblLastServiceTypeCode.Text = Converter.GetString(getDTO.ServiceType);
                    lblLastServiceType.Text     = Converter.GetString(getDTO.EmpSTypeDesc);

                    if (lblLastServiceTypeCode.Text == string.Empty || lblLastServiceTypeCode.Text == "0")
                    {
                        ddlNewServiceType.SelectedIndex = 0;
                    }
                    else
                    {
                        ddlNewServiceType.SelectedValue = Converter.GetString(getDTO.ServiceType);
                    }

                    lblLastProjectCode.Text = Converter.GetString(getDTO.EmpProject);
                    if (lblLastProjectCode.Text == string.Empty || lblLastProjectCode.Text == "0")
                    {
                        ddlNewProject.SelectedIndex = 0;
                    }
                    else
                    {
                        ddlNewProject.SelectedValue = Converter.GetString(getDTO.EmpProject);
                    }

                    lblLastProject.Text = Converter.GetString(ddlNewProject.SelectedItem.Text);


                    int          cashcode = Converter.GetInteger(getDTO.EmpCashCode);
                    A2ZCGLMSTDTO get5DTO  = (A2ZCGLMSTDTO.GetInformation(cashcode));
                    if (get5DTO.GLAccNo > 0)
                    {
                        lblLastCashCode.Text         = Converter.GetString(get5DTO.GLAccNo);
                        lblLastCashCodeDesc.Text     = Converter.GetString(get5DTO.GLAccDesc);
                        ddlNewCashCode.SelectedValue = Converter.GetString(get5DTO.GLAccNo);
                    }


                    lblLastBaseGradeCode.Text = Converter.GetString(getDTO.EmpBaseGrade);
                    if (lblLastBaseGradeCode.Text == string.Empty || lblLastBaseGradeCode.Text == "0")
                    {
                        ddlNewBaseGrade.SelectedIndex = 0;
                    }
                    else
                    {
                        ddlNewBaseGrade.SelectedValue = Converter.GetString(getDTO.EmpBaseGrade);
                    }

                    lblLastBaseGrade.Text = Converter.GetString(ddlNewBaseGrade.SelectedItem.Text);



                    lblLastGrade.Text     = Converter.GetString(getDTO.EmpGrade);
                    lblLastGradeDesc.Text = Converter.GetString(getDTO.EmpGradeDesc);
                    txtNewGrade.Text      = Converter.GetString(getDTO.EmpGrade);
                    lblNewGradeDesc.Text  = Converter.GetString(getDTO.EmpGradeDesc);

                    lblBaseGrade.Text = lblLastBaseGradeCode.Text;
                    lblGrade.Text     = lblLastGrade.Text;
                    PayScaleDesc();
                    lblLastPayScale.Text = lblPayScale.Text;

                    lblBaseGrade.Text = ddlNewBaseGrade.SelectedValue;
                    lblGrade.Text     = txtNewGrade.Text;
                    PayScaleDesc();
                    txtNewPayScale.Text = lblPayScale.Text;


                    lblLastPayLabel.Text = Converter.GetString(getDTO.EmpPayLabel);
                    txtNewPayLabel.Text  = Converter.GetString(getDTO.EmpPayLabel);

                    if (txtNewPayLabel.Text == string.Empty || txtNewPayLabel.Text == "0")
                    {
                        txtNewPayLabel.Text = "1";
                    }

                    lblPayLabel.Text = lblLastPayLabel.Text;
                    PayLabelBasic();
                    lblLastBasic.Text = lblBasic.Text;

                    lblPayLabel.Text = txtNewPayLabel.Text;
                    PayLabelBasic();
                    txtNewBasic.Text = lblBasic.Text;


                    if (getDTO.EmpLastPromotionDate == DateTime.MinValue)
                    {
                        txtLastPromotionDate.Text = string.Empty;
                    }
                    else
                    {
                        DateTime dt   = Converter.GetDateTime(getDTO.EmpLastPromotionDate);
                        string   date = dt.ToString("dd/MM/yyyy");
                        txtLastPromotionDate.Text = date;
                    }
                }
                else
                {
                    txtEmpNo.Text = string.Empty;
                    txtEmpNo.Focus();
                    InvalidEmpCodeMSG();
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.btnSumbit_Click Problem');</script>");
                //throw ex;
            }
        }