Beispiel #1
0
        public HttpResponseMessage ModifySection(ModifySectionDTO obj)
        {
            HttpResponseMessage message;

            try
            {
                SectionDAL dal    = new SectionDAL();
                var        dynobj = new { result = dal.ModifySection(obj) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynobj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "something Wrong.Try Again!" });
            }
            return(message);
        }
Beispiel #2
0
        public bool ModifySection(ModifySectionDTO obj)
        {
            bool res = false;

            obj.ModifiedBy = "1002";
            SqlCommand cmd = new SqlCommand("sp_ModifySection");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_ClassId", obj.ClassId);
            cmd.Parameters.AddWithValue("@p_DepartmentId", obj.DepartmentId);
            cmd.Parameters.AddWithValue("@p_Section", obj.Section);
            cmd.Parameters.AddWithValue("@p_Code", obj.Code);
            cmd.Parameters.AddWithValue("@p_SectionId", obj.SectionId);
            cmd.Parameters.AddWithValue("@p_ActionBy", obj.ModifiedBy);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }