Esempio n. 1
0
        public ApiResponse <FirmEntity> UpdateFirm(FirmEntity model, string EmpID, string UserID)
        {
            var response = new ApiResponse <FirmEntity>();

            try
            {
                string xmlData = ConvertToXml <FirmEntity> .GetXMLString(new List <FirmEntity>() { model });

                SqlParameter[] param =
                {
                    new SqlParameter("LoginEmpId", (object)EmpID ?? (object)DBNull.Value)
                    ,                              new SqlParameter("UserID", (object)UserID ?? (object)DBNull.Value)
                    ,                              new SqlParameter("FirmID", (object)model.FirmID ?? (object)DBNull.Value)
                    ,                              new SqlParameter("xmlDataString", (object)xmlData ?? (object)DBNull.Value)
                };

                var result = _repository.ExecuteSQL <FirmEntity>("UpdateFirm", param).ToList();
                if (result == null)
                {
                    result = new List <FirmEntity>();
                }

                response.Success = true;
                response.Data    = result;
            }
            catch (Exception ex)
            {
                response.Message.Add(ex.Message);
            }
            return(response);
        }
Esempio n. 2
0
        public BaseApiResponse InsertFirm(FirmEntity model, string EmpID, string UserID)
        {
            var response = new BaseApiResponse();

            try
            {
                string xmlData = ConvertToXml <FirmEntity> .GetXMLString(new List <FirmEntity>() { model });

                SqlParameter[] param =
                {
                    new SqlParameter("LoginEmpId", (object)EmpID ?? (object)DBNull.Value)
                    ,                              new SqlParameter("UserID", (object)UserID ?? (object)DBNull.Value)
                    ,                              new SqlParameter("xmlDataString", (object)xmlData ?? (object)DBNull.Value)
                };
                var result = _repository.ExecuteSQL <int>("InsertFirm", param).FirstOrDefault();
                if (result > 0)
                {
                    response.Success = true;
                }
            }
            catch (Exception ex)
            {
                response.Message.Add(ex.Message);
            }
            return(response);
        }
Esempio n. 3
0
        public BaseApiResponse InsertNewFirmFromStep5(FirmEntity modal)
        {
            var response = new BaseApiResponse();

            try
            {
                SqlParameter[] param = { new SqlParameter("FirmName",  (object)modal.FirmName ?? (object)DBNull.Value),
                                         new SqlParameter("City",      (object)modal.City ?? (object)DBNull.Value),
                                         new SqlParameter("CreatedBy", (object)modal.EntBy ?? (object)DBNull.Value),
                                         new SqlParameter("CompanyNo", (object)modal.CompanyNo ?? (object)DBNull.Value), };
                var            result = _repository.ExecuteSQL <string>("InsertNewFirmFromStep5", param).FirstOrDefault();

                if (result != null)
                {
                    response.Success          = true;
                    response.str_ResponseData = result;
                }
            }
            catch (Exception ex)
            {
                response.Message.Add(ex.Message);
            }

            return(response);
        }
Esempio n. 4
0
 public static Firm ToObject(this FirmEntity entity)
 {
     return(new Firm(entity.Name, entity.Sphere, entity.Quantity_of_employee, entity.Market_experience));
 }