protected void dgvdistrict_RowEditing(object sender, GridViewEditEventArgs e)
        {
            DistrictId = Convert.ToInt32(dgvdistrict.DataKeys[e.NewEditIndex].Value);
            BusinessLayer.SMS.district objdistrict = new BusinessLayer.SMS.district();

            Entity.SMS.district district = new Entity.SMS.district();
            district             = objdistrict.GetAllById(DistrictId);
            txtdistrictname.Text = district.DistrictName.ToString();
            txtShortName.Text    = district.ShortName.ToString();
            btnsubmit.Text       = "update";
        }
 protected void btnsubmit_Click(object sender, EventArgs e)
 {
     BusinessLayer.SMS.district objdistrict    = new BusinessLayer.SMS.district();
     Entity.SMS.district        Entitydistrict = new Entity.SMS.district();
     Entitydistrict.DistrictId   = DistrictId;
     Entitydistrict.DistrictName = txtdistrictname.Text.Trim();
     Entitydistrict.ShortName    = txtShortName.Text.Trim();
     objdistrict.Save(Entitydistrict);
     loaddistrict();
     clearcontrol();
 }
Exemplo n.º 3
0
        public static void Save(Entity.SMS.district Entitydistrict)
        {
            using (DataManager oDm = new DataManager())
            {
                oDm.Add("@pDistrictId", SqlDbType.Int, ParameterDirection.InputOutput, Entitydistrict.DistrictId);
                oDm.Add("@pDistrictName", SqlDbType.VarChar, 50, Entitydistrict.DistrictName);
                oDm.Add("@pShortName", SqlDbType.VarChar, 50, Entitydistrict.ShortName);
                oDm.Add("@pIsActive", SqlDbType.Bit, Entitydistrict.IsActive);

                oDm.CommandType = CommandType.StoredProcedure;
                oDm.ExecuteNonQuery("sp_district_save");
            }
        }
Exemplo n.º 4
0
 public static Entity.SMS.district GetAllById(int DistrictId)
 {
     using (DataManager oDm = new DataManager())
     {
         oDm.CommandType = CommandType.StoredProcedure;
         oDm.Add("@pDistrictId", SqlDbType.Int, ParameterDirection.Input, DistrictId);
         SqlDataReader       dr             = oDm.ExecuteReader("usp_district_GetAllById");
         Entity.SMS.district Entitydistrict = new Entity.SMS.district();
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 Entitydistrict.DistrictId   = DistrictId;
                 Entitydistrict.DistrictName = (dr[1] == DBNull.Value) ? "" : dr[1].ToString();
                 Entitydistrict.ShortName    = (dr[2] == DBNull.Value) ? "" : dr[2].ToString();
                 Entitydistrict.IsActive     = (dr[3] == DBNull.Value) ? true : Convert.ToBoolean(dr[3].ToString());
             }
         }
         return(Entitydistrict);
     }
 }
Exemplo n.º 5
0
 public void Save(Entity.SMS.district Entitydistrict)
 {
     DataAccess.SMS.district.Save(Entitydistrict);
 }