Ejemplo n.º 1
0
        public SubDocumentCategoryMasterResponse InsertUpdateSubDocumentCategoryMaster
            ([FromBody] SubDocumentCategoryMaster objSubDocumentCategoryMaster)
        {
            var objMaster = _Kernel.Get <IMaster>();
            var objSubDocumentCategoryMasterResponse = objMaster.
                                                       InsertUpdateSubDocumentCategoryMaster(objSubDocumentCategoryMaster);

            return(objSubDocumentCategoryMasterResponse);
        }
Ejemplo n.º 2
0
        public SubDocumentCategoryMasterResponse InsertUpdateSubDocumentCategoryMaster
            (SubDocumentCategoryMaster objSubDocumentCategoryMaster)
        {
            try
            {
                Log.Info("Started call to InsertUpdateSubDocumentCategoryMaster");
                Log.Info("parameter values"
                         + JsonConvert.SerializeObject(objSubDocumentCategoryMaster));
                Command.CommandText = "SP_SUB_DOCUMENT_CATEGORY_MANAGER";
                Command.CommandType = CommandType.StoredProcedure;
                Command.Parameters.Clear();

                Command.Parameters.AddWithValue("@SUB_DOCUMENT_CATEGORY_XML", GetXMLFromObject(objSubDocumentCategoryMaster));

                if (objSubDocumentCategoryMaster.AddedBy.HasValue)
                {
                    Command.Parameters.AddWithValue("@USER_ID", objSubDocumentCategoryMaster.AddedBy.Value);
                }
                if (objSubDocumentCategoryMaster.ModifiedBy.HasValue)
                {
                    Command.Parameters.AddWithValue("@USER_ID", objSubDocumentCategoryMaster.ModifiedBy.Value);
                }
                Connection.Open();
                SqlDataReader reader = Command.ExecuteReader();

                SubDocumentCategoryMasterResponse result = new SubDocumentCategoryMasterResponse();
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        result = new SubDocumentCategoryMasterResponse
                        {
                            Id        = Convert.ToInt32(reader["Id"].ToString()),
                            Message   = reader["ReturnMessage"] != DBNull.Value ? reader["ReturnMessage"].ToString() : null,
                            IsSuccess = Convert.ToBoolean(reader["Result"].ToString())
                        };
                    }
                }
                Log.Info("End call to InsertUpdateSubDocumentCategoryMaster. Result:"
                         + JsonConvert.SerializeObject(result));
                return(result);
            }
            catch (Exception ex)
            {
                Log.Error("Error in InsertUpdateSubDocumentCategoryMaster. Error:"
                          + JsonConvert.SerializeObject(ex));
                LogError(ex);
                throw;
            }
            finally
            {
                Connection.Close();
            }
        }
Ejemplo n.º 3
0
 public SubDocumentCategoryMasterResponse InsertUpdateSubDocumentCategoryMaster
     (SubDocumentCategoryMaster objSubDocumentCategoryMaster)
 {
     try
     {
         return(this._masterDA.InsertUpdateSubDocumentCategoryMaster(objSubDocumentCategoryMaster));
     }
     catch (Exception ex)
     {
         throw;
     }
     finally
     {
     }
 }