Esempio n. 1
0
        public HttpResponseMessage UpdateSalaryComponent(UpdateMapping_SalaryComponents obj)
        {
            HttpResponseMessage message;

            try
            {
                // Mapping_SalaryComponentsDAL dal = new Mapping_SalaryComponentsDAL();
                var dynObj = new { result = _salary.UpdateMapping_SalaryComponents(obj) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = " Somthing wrong,try Again!" });
                ErrorLog.CreateErrorMessage(ex, "Mapping_SalaryComponents", "Update Mapping_SalaryComponents");
            }
            return(message);
        }
        public bool UpdateMapping_SalaryComponents(UpdateMapping_SalaryComponents obj)
        {
            bool       res    = false;
            SqlCommand SqlCmd = new SqlCommand("sp_UpdateMappingComponents");

            SqlCmd.CommandType = CommandType.StoredProcedure;
            SqlCmd.Parameters.AddWithValue("@MappingId", obj.MappingId);
            SqlCmd.Parameters.AddWithValue("@ComponentId", obj.ComponentId);
            SqlCmd.Parameters.AddWithValue("@ManpowerId", obj.ManpowerId);
            SqlCmd.Parameters.AddWithValue("@Amount", obj.Amount);
            SqlCmd.Parameters.AddWithValue("@IsActive", obj.IsActive);
            SqlCmd.Parameters.AddWithValue("@ModifiedBy", obj.ActionBy);
            int result = _unitOfWork.DbLayer.ExecuteNonQuery(SqlCmd);

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