Example #1
0
        public void Add(LkpUnitType lkpUnitType)
        {
            List <SqlParameter> lstSqlParameter = new List <SqlParameter>();

            lstSqlParameter.Add(new SqlParameter("@unitType", lkpUnitType.UnitType));
            lstSqlParameter.Add(new SqlParameter("@unitTypeDesc", lkpUnitType.UnitTypeDesc));


            SqlHelper.ExecuteStoredProcedure(StoredProcedureConstants.LkpUnitType.ADDLKPUNITTYPEPRC, lstSqlParameter);
        }
Example #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            LkpUnitType lkpUnitType = new LkpUnitType();

            lkpUnitType.UnitType     = txtUnitType.Text;
            lkpUnitType.UnitTypeDesc = txtUnitTypeDesc.Text;
            lkpUnitTypeManager.Add(lkpUnitType);
            BindLkpUnitTypeGrid();
            ResetControls();
        }
Example #3
0
        public LkpUnitType GetById(int id)
        {
            List <SqlParameter> lstSqlParameter = new List <SqlParameter>();

            lstSqlParameter.Add(new SqlParameter("@lkpUnitType", id));
            ds = SqlHelper.ExecuteStoredProcedure(StoredProcedureConstants.LkpUnitType.GETLKPUNITTYPEPRC, lstSqlParameter, "LkpUnitType");
            LkpUnitType lkpUnitType = new LkpUnitType();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                lkpUnitType.Id           = Convert.ToInt32(ds.Tables[0].Rows[i]["Id"]);
                lkpUnitType.UnitType     = Convert.ToString(ds.Tables[0].Rows[i]["UnitType"]);
                lkpUnitType.UnitTypeDesc = Convert.ToString(ds.Tables[0].Rows[i]["UnitTypeDesc"]);
            }
            return(lkpUnitType);
        }
Example #4
0
        public List <LkpUnitType> GetAll()
        {
            ds = SqlHelper.ExecuteStoredProcedure(StoredProcedureConstants.LkpUnitType.GETLKPUNITTYPEPRC);

            List <LkpUnitType> lstLkpUnitType = new List <LkpUnitType>();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                LkpUnitType lkpUnitType = new LkpUnitType();
                lkpUnitType.Id           = Convert.ToInt32(ds.Tables[0].Rows[i]["Id"]);
                lkpUnitType.UnitType     = Convert.ToString(ds.Tables[0].Rows[i]["UnitType"]);
                lkpUnitType.UnitTypeDesc = Convert.ToString(ds.Tables[0].Rows[i]["UnitTypeDesc"]);

                lstLkpUnitType.Add(lkpUnitType);
            }
            return(lstLkpUnitType);
        }
Example #5
0
        protected void grvUnitType_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            int         UnitTypeId = Convert.ToInt32(grvUnitType.DataKeys[e.RowIndex].Value.ToString());
            GridViewRow row        = (GridViewRow)grvUnitType.Rows[e.RowIndex];

            TextBox textUnitType     = (TextBox)row.Cells[1].Controls[0];
            TextBox textUnitTypeDesc = (TextBox)row.Cells[2].Controls[0];

            LkpUnitType lkpUnitType = new LkpUnitType();

            lkpUnitType.Id           = UnitTypeId;
            lkpUnitType.UnitType     = textUnitType.Text;
            lkpUnitType.UnitTypeDesc = textUnitTypeDesc.Text;

            lkpUnitTypeManager.Update(lkpUnitType);

            grvUnitType.EditIndex = -1;
            BindLkpUnitTypeGrid();
        }
Example #6
0
 public void Update(LkpUnitType lkpUnitType)
 {
     lkpUnitTypeService.Update(lkpUnitType);
 }
Example #7
0
 public void Add(LkpUnitType lkpUnitType)
 {
     lkpUnitTypeService.Add(lkpUnitType);
 }