public HttpResponseMessage ClientGivenInstalledSave(ServiceSheetZipItem model)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.Created);

            try
            {
                model.CurUserAdSid = GetCurUser().Sid;
                model.ClientGivenInstalledSave();
                response.Content = new StringContent($"{{\"id\":{model.Id}}}");
            }
            catch (Exception ex)
            {
                response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(MessageHelper.ConfigureExceptionMessage(ex));

            }
            return response;
        }
 public ServiceSheetZipItem Get(int id)
 {
     var model = new ServiceSheetZipItem(id);
     return model;
 }
        /// <summary>
        /// Возвращает заказанный для сервисного листа ЗИП
        /// </summary>
        /// <param name="serviceSheetId"></param>
        /// <param name="realyOrdered">Был ли оформлен заказ ЗИП СТП или еще в промежуточной стадии</param>
        /// <returns></returns>
        public static IEnumerable<ServiceSheetZipItem> GetOrderedList(int serviceSheetId, bool? realyOrdered = null)
        {
            SqlParameter pServiceSheetId = new SqlParameter() { ParameterName = "id_service_sheet", SqlValue = serviceSheetId, SqlDbType = SqlDbType.Int };
            SqlParameter pRealyOrdered = new SqlParameter() { ParameterName = "ordered", SqlValue = realyOrdered, SqlDbType = SqlDbType.Bit };
            var dt = Db.Service.ExecuteQueryStoredProcedure("service_sheet_ordered_zip_item_get_list", pServiceSheetId, pRealyOrdered);

            var lst = new List<ServiceSheetZipItem>();

            foreach (DataRow row in dt.Rows)
            {
                var model = new ServiceSheetZipItem(row);
                lst.Add(model);
            }

            return lst;
        }
Exemple #4
0
        public static IEnumerable<ServiceSheetZipItem> GetOrderedZipItemList(int claimId, int? serviceSheetId = null)
        {
            SqlParameter pClaimId = new SqlParameter() { ParameterName = "claim_id", SqlValue = claimId, SqlDbType = SqlDbType.Int };
            SqlParameter pServiceSheetId = new SqlParameter() { ParameterName = "id_service_sheet", SqlValue = serviceSheetId, SqlDbType = SqlDbType.Int };
            var dt = Db.Service.ExecuteQueryStoredProcedure("claim_ordered_zip_item_list_get", pClaimId, pServiceSheetId);

            var lst = new List<ServiceSheetZipItem>();

            foreach (DataRow row in dt.Rows)
            {
                var model = new ServiceSheetZipItem(row);
                lst.Add(model);
            }

            return lst;
        }
        public static IEnumerable<ServiceSheetZipItem> GetClientGivenInstalledZipItemList(int serviceSheetId)
        {
            SqlParameter pServiceSheetId = new SqlParameter() { ParameterName = "id_service_sheet", SqlValue = serviceSheetId, SqlDbType = SqlDbType.Int };
            var dt = Db.Service.ExecuteQueryStoredProcedure("service_sheet_client_given_installed_zip_item_get_list", pServiceSheetId);

            var lst = new List<ServiceSheetZipItem>();

            foreach (DataRow row in dt.Rows)
            {
                var model = new ServiceSheetZipItem(row);
                lst.Add(model);
            }

            return lst;
        }