Ejemplo n.º 1
0
        public DataSet LayDanhSachNhomTaiSan()
        {
            DataSet dsNhomTS = new DataSet();

            //Kiem tra ket noi server, service
            Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri());
            TruyVanRequest  request  = Common.Utilities.PrepareRequest(new TruyVanRequest());
            TruyVanResponse response = new TruyVanResponse();

            try
            {
                DataTable dtThamso = null;
                LDatatable.MakeParameterTable(ref dtThamso);
                request.dtThamSo    = dtThamso;
                request.objectName  = "INQ.TS.DS_NHOM_TS";
                request.inquiryName = "DS_NHOM_BCAO";

                //make a call service client
                response = ClientTruyVan.TruyVanMessage(request);

                if (response != null && response.ResponseStatus == ApplicationConstant.ResponseStatus.THANH_CONG)
                {
                    dsNhomTS = response.dsResult;
                }
                return(dsNhomTS);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
                return(null);
            }
        }
Ejemplo n.º 2
0
        public DataSet GetTreeViewNhomTaiSan()
        {
            //Kiem tra ket noi server, service truoc khi request
            Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri());
            TruyVanRequest  request      = Common.Utilities.PrepareRequest(new TruyVanRequest());
            TruyVanResponse response     = new TruyVanResponse();
            DataSet         dsNhomTaisan = null;

            try
            {
                DataTable dtThamSo = null;
                LDatatable.MakeParameterTable(ref dtThamSo);
                LDatatable.AddParameter(ref dtThamSo, "", "", "");
                request.dtThamSo    = dtThamSo;
                request.objectName  = "INQ.TS_PLOAI_TS";
                request.inquiryName = "TREE_PLOAI_TS";

                //make a call to service client
                response = ClientTruyVan.TruyVanMessage(request);

                //kiem tra ket qua tra ve
                Common.Utilities.ValidResponse(request, response);
                if (response != null && response.ResponseStatus == ApplicationConstant.ResponseStatus.THANH_CONG)
                {
                    dsNhomTaisan = response.dsResult;
                }
                return(dsNhomTaisan);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
                return(null);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Lay danh sach tai khoan hach toan
        /// </summary>
        /// <param name="MaNhomTS"></param>
        /// <returns></returns>

        public DataSet GetDSTaiKhoanHachToan(string MaNhomTS)
        {
            // Kiểm tra kết nối, server, service trước khi request
            Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri());

            // Khởi tạo và gán các giá trị cho request
            TruyVanRequest request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest());

            TruyVanResponse response = new TruyVanServiceRef.TruyVanResponse();
            DataTable       dt       = null;

            LDatatable.MakeParameterTable(ref dt);
            if (MaNhomTS.Equals(""))
            {
                LDatatable.AddParameter(ref dt, "", "", "");
                request.dtThamSo    = dt;
                request.objectName  = "INQ.TS.TAI_KHOAN";
                request.inquiryName = "TAI_KHOAN";
            }
            else
            {
                LDatatable.AddParameter(ref dt, "@MA_NHOM_TS", "String", MaNhomTS);
                request.dtThamSo    = dt;
                request.objectName  = "INQ.TS.TAI_KHOAN";
                request.inquiryName = "MA_NHOM_TS";
            }

            // Lấy kết quả trả về
            response = ClientTruyVan.TruyVanMessage(request);

            // Kiểm tra kết quả trả về
            Common.Utilities.ValidResponse(request, response);

            return(response.dsResult);
        }
Ejemplo n.º 4
0
        public DataSet GetTaiKhoanHachToan(string maDoiTuong, string maDonVi)
        {
            TruyVanServiceClient client   = null;
            TruyVanRequest       request  = null;
            TruyVanResponse      response = null;

            try
            {
                // Kiểm tra kết nối, server, service trước khi request
                Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri());

                client   = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService);
                request  = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest());
                response = new TruyVanServiceRef.TruyVanResponse();

                DataTable dt = null;

                LDatatable.MakeParameterTable(ref dt);
                LDatatable.AddParameter(ref dt, "@MA_PHAN_HE", "STRING", DatabaseConstant.Module.TDTT.getValue());
                LDatatable.AddParameter(ref dt, "@MA_DTUONG", "STRING", maDoiTuong);
                LDatatable.AddParameter(ref dt, "@MA_DON_VI", "STRING", maDonVi);

                request.dtThamSo    = dt;
                request.objectName  = "INQ.CT.TD_SAN_PHAM";
                request.inquiryName = "TAI_KHOAN_HACH_TOAN";


                // make a call to service client here
                response = client.TruyVanMessage(request);

                //Kiểm tra kết quả trả về
                Common.Utilities.ValidResponse(request, response);

                DataSet ds = response.dsResult;
                return(ds);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                if (client.State == CommunicationState.Faulted)
                {
                    client.Abort();
                }
                else
                {
                    client.Close();
                }

                client   = null;
                request  = null;
                response = null;
            }
        }
Ejemplo n.º 5
0
        public DataSet GetHanMucChiTiet(string maLoaiDTuong, string maDTuong, string module, string tinhNang)
        {
            TruyVanServiceClient client   = null;
            TruyVanRequest       request  = null;
            TruyVanResponse      response = null;

            try
            {
                // Kiểm tra kết nối, server, service trước khi request
                Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri());

                client   = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService);
                request  = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest());
                response = new TruyVanServiceRef.TruyVanResponse();

                //Khởi tạo request
                DataTable dt = null;
                LDatatable.MakeParameterTable(ref dt);
                LDatatable.AddParameter(ref dt, "@MA_DTUONG_LOAI", "STRING", maLoaiDTuong);
                LDatatable.AddParameter(ref dt, "@MA_DTUONG", "STRING", maDTuong);
                LDatatable.AddParameter(ref dt, "@MODULE", "STRING", module);
                LDatatable.AddParameter(ref dt, "@TINH_NANG", "STRING", tinhNang);

                request.dtThamSo    = dt;
                request.objectName  = "INQ.DS.HAN_MUC";
                request.inquiryName = "CHI_TIET";

                // make a call to service client here
                response = client.TruyVanMessage(request);

                //Kiểm tra kết quả trả về
                Common.Utilities.ValidResponse(request, response);

                DataSet ds = response.dsResult;
                return(ds);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                if (client.State == CommunicationState.Faulted)
                {
                    client.Abort();
                }
                else
                {
                    client.Close();
                }

                client   = null;
                request  = null;
                response = null;
            }
        }
Ejemplo n.º 6
0
        public DataSet GetDanhSachHanMucKhachHangChiTiet(DataTable dt)
        {
            TruyVanServiceClient client   = null;
            TruyVanRequest       request  = null;
            TruyVanResponse      response = null;

            try
            {
                // Kiểm tra kết nối, server, service trước khi request
                Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri());

                client   = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService);
                request  = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest());
                response = new TruyVanServiceRef.TruyVanResponse();

                //Khởi tạo request
                //DataTable dt = null;
                //LDatatable.MakeParameterTable(ref dt);
                //LDatatable.AddParameter(ref dt, "@TRANG_THAI_NVU", "STRING", trangThaiNVu);
                //LDatatable.AddParameter(ref dt, "@MA_DVI", "STRING", maDonVi);

                request.dtThamSo    = dt;
                request.objectName  = "INQ.DS.HMUC_KHACH_HANG_CTIET";
                request.inquiryName = "DANH_SACH";

                // make a call to service client here
                response = client.TruyVanMessage(request);

                //Kiểm tra kết quả trả về
                Common.Utilities.ValidResponse(request, response);

                DataSet ds = response.dsResult;
                return(ds);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                if (client.State == CommunicationState.Faulted)
                {
                    client.Abort();
                }
                else
                {
                    client.Close();
                }

                client   = null;
                request  = null;
                response = null;
            }
        }
Ejemplo n.º 7
0
        public DataSet GetResultCT(DataTable dt)
        {
            TruyVanServiceClient client   = null;
            TruyVanRequest       request  = null;
            TruyVanResponse      response = null;

            try
            {
                // Kiểm tra kết nối, server, service trước khi request
                Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri());

                client   = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService);
                request  = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest());
                response = new TruyVanServiceRef.TruyVanResponse();

                //Khởi tạo request

                request.dtThamSo    = dt;
                request.objectName  = "INQ.DS.COB";
                request.inquiryName = "RESULT_CT";

                // make a call to service client here
                response = client.TruyVanMessage(request);

                //Kiểm tra kết quả trả về
                Common.Utilities.ValidResponse(request, response);

                DataSet ds = response.dsResult;
                return(ds);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                if (client.State == CommunicationState.Faulted)
                {
                    client.Abort();
                }
                else
                {
                    client.Close();
                }

                client   = null;
                request  = null;
                response = null;
            }
        }