Ejemplo n.º 1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        HR_EmployeeSalary hR_EmployeeSalary = new HR_EmployeeSalary();
        //	hR_EmployeeSalary.EmployeeSalaryID=  int.Parse(ddlEmployeeSalaryID.SelectedValue);
        hR_EmployeeSalary.EmployeeID = Profile.card_id;
        hR_EmployeeSalary.IsGross = radIsGross.SelectedValue == "True" ? true : false;
        hR_EmployeeSalary.BasicAmount = decimal.Parse(txtAmount.Text);
        hR_EmployeeSalary.IsActive = true;// bool.Parse(radIsActive.SelectedValue);
        hR_EmployeeSalary.AddedBy = Profile.card_id;
        hR_EmployeeSalary.AddedDate = DateTime.Now;
        hR_EmployeeSalary.ModifiedBy = Profile.card_id;
        hR_EmployeeSalary.ModifiedDate = DateTime.Now;
        int resutl = HR_EmployeeSalaryManager.InsertHR_EmployeeSalary(hR_EmployeeSalary);

        RefreshPackageRelues();

        foreach (HR_PackageRules packageRules in ListPackageRules)
        {
            HR_EmployeeSalaryRules hR_EmployeeSalaryRules = new HR_EmployeeSalaryRules();

            hR_EmployeeSalaryRules.EmployeeID = Profile.card_id;
            hR_EmployeeSalaryRules.PackageRulesID = packageRules.PackageRulesID;
            hR_EmployeeSalaryRules.AddedBy = Profile.card_id;
            hR_EmployeeSalaryRules.AddedDate = DateTime.Now;
            hR_EmployeeSalaryRules.UpdatedBy = Profile.card_id;
            hR_EmployeeSalaryRules.UpdatedDate = DateTime.Now;
            int resID = HR_EmployeeSalaryRulesManager.InsertHR_EmployeeSalaryRules(hR_EmployeeSalaryRules);
        }
        Response.Redirect("AdminDisplayHR_EmployeeSalary.aspx");
    }
Ejemplo n.º 2
0
 public static HR_EmployeeSalary GetHR_EmployeeSalaryByEmployeeSalaryID(int EmployeeSalaryID)
 {
     HR_EmployeeSalary hR_EmployeeSalary = new HR_EmployeeSalary();
     SqlHR_EmployeeSalaryProvider sqlHR_EmployeeSalaryProvider = new SqlHR_EmployeeSalaryProvider();
     hR_EmployeeSalary = sqlHR_EmployeeSalaryProvider.GetHR_EmployeeSalaryByEmployeeSalaryID(EmployeeSalaryID);
     return hR_EmployeeSalary;
 }
Ejemplo n.º 3
0
 private void showHR_EmployeeSalaryData()
 {
     HR_EmployeeSalary hR_EmployeeSalary = new HR_EmployeeSalary();
     hR_EmployeeSalary = HR_EmployeeSalaryManager.GetHR_EmployeeSalaryByEmployeeSalaryID(Int32.Parse(Request.QueryString["ID"]));
     radIsGross.SelectedValue = hR_EmployeeSalary.IsGross.ToString();
     txtAmount.Text = hR_EmployeeSalary.BasicAmount.ToString();
     // radIsActive.SelectedValue  =hR_EmployeeSalary.IsActive.ToString();
 }
Ejemplo n.º 4
0
    protected void btnUpdateEmployeeSalary_Click(object sender, EventArgs e)
    {
        if (hfEmployeeID.Value == null)
        {
            lblSalaryMsg.Text = "Invalid Employee";
            lblSalaryMsg.ForeColor = System.Drawing.Color.Red;
            UpdatePanel1.Update();
            return;
        }

        if (hfEmployeeID.Value.ToString() != string.Empty)
        {
            if (txtAmount.Text.Trim() == string.Empty)
            {
                lblSalaryMsg.Text = "Amount is Empty";
                lblSalaryMsg.ForeColor = System.Drawing.Color.Red;
                UpdatePanel1.Update();
                return;
            }

            HR_EmployeeSalary hR_EmployeeSalary = new HR_EmployeeSalary();
            hR_EmployeeSalary.EmployeeID = hfEmployeeID.Value.ToString();
            hR_EmployeeSalary.IsGross = radIsGross.SelectedValue == "Gross" ? true : false;
            if (hR_EmployeeSalary.IsGross)
            {
                hR_EmployeeSalary.GrossAmount = decimal.Parse(txtAmount.Text);
            }
            else
            {
                hR_EmployeeSalary.BasicAmount = decimal.Parse(txtAmount.Text);
            }

            hR_EmployeeSalary.IsActive = true;
            string userID = Profile.card_id;
            hR_EmployeeSalary.AddedBy = userID;
            hR_EmployeeSalary.AddedDate = DateTime.Now;
            hR_EmployeeSalary.ModifiedBy = userID;
            hR_EmployeeSalary.ModifiedDate = DateTime.Now;

            if (hdnEmployeeSalaryID.Value == string.Empty)
            {
                if (HR_EmployeeSalaryManager.IsEmployeeExist(hfEmployeeID.Value.ToString()))
                {
                    lblSalaryMsg.Text = "Employee's salary information is Exist";
                    lblSalaryMsg.ForeColor = System.Drawing.Color.BlueViolet;
                }
                else
                {
                    int resutl = HR_EmployeeSalaryManager.InsertHR_EmployeeSalary(hR_EmployeeSalary);
                }
            }
            else
            {
                hR_EmployeeSalary.EmployeeSalaryID = Convert.ToInt32(hdnEmployeeSalaryID.Value);
                HR_EmployeeSalaryManager.UpdateHR_EmployeeSalary(hR_EmployeeSalary);
            }

            if (HR_EmployeeSalaryRulesManager.IsEmployeeExist(hfEmployeeID.Value.ToString()))
            {
                HR_EmployeeSalaryRulesManager.DeleteHR_EmployeeSalaryRulesByEmployeeID(hfEmployeeID.Value.ToString());
            }

                RefreshPackageRelues();
                foreach (HR_PackageRules packageRules in _ListPackageRules)
                {
                    HR_EmployeeSalaryRules hR_EmployeeSalaryRules = new HR_EmployeeSalaryRules();

                    hR_EmployeeSalaryRules.EmployeeID = hfEmployeeID.Value.ToString();
                    hR_EmployeeSalaryRules.PackageRulesID = packageRules.PackageRulesID;
                   // string userID = Profile.card_id;
                    hR_EmployeeSalaryRules.AddedBy = userID;
                    hR_EmployeeSalaryRules.AddedDate = DateTime.Now;
                    hR_EmployeeSalaryRules.UpdatedBy = userID;
                    hR_EmployeeSalaryRules.UpdatedDate = DateTime.Now;
                    int resID = HR_EmployeeSalaryRulesManager.InsertHR_EmployeeSalaryRules(hR_EmployeeSalaryRules);
                }
                lblSalaryMsg.Text = "Salary Information is saved";
                lblSalaryMsg.ForeColor = System.Drawing.Color.Green;

        }
        else
        {
            lblSalaryMsg.Text = "Employee is not specified.";
            lblSalaryMsg.ForeColor = System.Drawing.Color.Red;
        }
        UpdatePanel1.Update();
    }
Ejemplo n.º 5
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     HR_EmployeeSalary hR_EmployeeSalary = new HR_EmployeeSalary();
     hR_EmployeeSalary.EmployeeSalaryID = int.Parse(Request.QueryString["ID"].ToString());
     hR_EmployeeSalary.EmployeeID = Profile.card_id;
     hR_EmployeeSalary.IsGross = radIsGross.SelectedValue == "True" ? true : false;
     hR_EmployeeSalary.BasicAmount = decimal.Parse(txtAmount.Text);
     hR_EmployeeSalary.IsActive = true;// bool.Parse(radIsActive.SelectedValue);
     hR_EmployeeSalary.AddedBy = Profile.card_id;
     hR_EmployeeSalary.AddedDate = DateTime.Now;
     hR_EmployeeSalary.ModifiedBy = Profile.card_id;
     hR_EmployeeSalary.ModifiedDate = DateTime.Now;
     bool resutl = HR_EmployeeSalaryManager.UpdateHR_EmployeeSalary(hR_EmployeeSalary);
     Response.Redirect("AdminDisplayHR_EmployeeSalary.aspx");
 }
Ejemplo n.º 6
0
 public static bool UpdateHR_EmployeeSalary(HR_EmployeeSalary hR_EmployeeSalary)
 {
     SqlHR_EmployeeSalaryProvider sqlHR_EmployeeSalaryProvider = new SqlHR_EmployeeSalaryProvider();
     return sqlHR_EmployeeSalaryProvider.UpdateHR_EmployeeSalary(hR_EmployeeSalary);
 }
Ejemplo n.º 7
0
 public static int InsertHR_EmployeeSalary(HR_EmployeeSalary hR_EmployeeSalary)
 {
     SqlHR_EmployeeSalaryProvider sqlHR_EmployeeSalaryProvider = new SqlHR_EmployeeSalaryProvider();
     return sqlHR_EmployeeSalaryProvider.InsertHR_EmployeeSalary(hR_EmployeeSalary);
 }