Exemplo n.º 1
0
    //-------------------------- asfor Cost 20161215_Anas -------------------------------------------
    private void BindGridPopUpCost()
    {
        LStblGradeCostDAL _dalLStblGradeCostDAL = null;
        Hashtable         _htParameters         = null;

        try
        {
            _dalLStblGradeCostDAL = new LStblGradeCostDAL();
            _htParameters         = new Hashtable();

            _htParameters["p_keywords"]      = txtSearchCost.Text;
            _htParameters["p_Employee_Code"] = txtEmployee_Code.Text;
            //string abc = Session[SessionKey.CURRENT_USER_HRMS_ROLE].ToString();
            //if (Session[SessionKey.CURRENT_USER_HRMS_ROLE].ToString() == "1")
            //{
            //    _htParameters["p_Employee_Code"] = Session[SessionKey.CURRENT_USER_HRMS_EMP_CODE].ToString();
            //}
            gvwListCost.DataSource = _dalLStblGradeCostDAL.GetRowsbyGrade(_htParameters);
            gvwListCost.DataBind();
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }
Exemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        LStblGradeCostDAL _dalLStblGradeCostDAL = null;
        Hashtable         _htParameters         = null;
        int    iNextID = 0;
        string message = "";

        try
        {
            foreach (GridViewRow row in gvwList.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    string p_GradeCode = row.Cells[1].Text;
                    string p_ID        = (row.Cells[3].FindControl("lblID") as Label).Text;
                    string p_Cost      = (row.Cells[3].FindControl("txtCost") as TextBox).Text;

                    _dalLStblGradeCostDAL = new LStblGradeCostDAL();
                    _htParameters         = new Hashtable();

                    _htParameters["p_GradeCode"] = p_GradeCode;
                    _htParameters["p_CostCode"]  = ddlCostCode.SelectedValue;
                    _htParameters["p_Cost"]      = double.Parse(string.IsNullOrEmpty(p_Cost) ? "0" : p_Cost);

                    if (p_ID == "")
                    {
                        Utility.ApplyDefaultProp(_htParameters);
                        _dalLStblGradeCostDAL.Insert(_htParameters, ref iNextID);
                        message = "Add Successfully ";
                    }
                    else
                    {
                        _htParameters["p_ID"] = p_ID;
                        Utility.ApplyDefaultProp(_htParameters);
                        _dalLStblGradeCostDAL.Update(_htParameters);
                        message = "Update Successfully";
                    }
                    if (message != "")
                    {
                        Utility.ShowMessageBoxAnas(Page, message, "Success");
                    }
                }
            }
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }
Exemplo n.º 3
0
    private void BindGrid()
    {
        LStblGradeCostDAL _dalLStblGradeCostDAL = null;
        Hashtable         _htParameters         = null;

        try
        {
            _dalLStblGradeCostDAL = new LStblGradeCostDAL();
            _htParameters         = new Hashtable();

            _htParameters["p_keywords"] = txtSearch.Text;
            _htParameters["p_CostType"] = ddlCostCode.SelectedValue;

            gvwList.DataSource = _dalLStblGradeCostDAL.GetRows(_htParameters);
            gvwList.DataBind();
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }