Пример #1
0
        private void btnCheckSoHoKhau_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                UtilitiesProcess process = new UtilitiesProcess();
                string           objType = "GIA_DINH";
                ApplicationConstant.UtilitesResponseMessage resMessage = ApplicationConstant.UtilitesResponseMessage.M_ResponseMessage_Utilities_ExistSoHoKhau;
                List <ClientResponseDetail> listClientResponseDetail   = new List <ClientResponseDetail>();
                bool ret = false;

                if (txtSoHoKhau.IsNullOrEmpty())
                {
                    CommonFunction.ThongBaoChuaNhap(lblSoHoKhau.Content.ToString());
                    txtSoHoKhau.Focus();
                    return;
                }

                //if (!LObject.IsNullOrEmpty(txtSoHoKhau.Text))
                //{
                //    if (!CommonFunction.IsValidFormat(ApplicationConstant.FormatType.HOKHAU,
                //        txtSoHoKhau.Text))
                //    {
                //        txtSoHoKhau.Focus();
                //        return;
                //    }
                //}

                Mouse.OverrideCursor = Cursors.Wait;

                if (txtSoHoKhau.Text.IsNullOrEmptyOrSpace())
                {
                    return;
                }

                ret = process.Utilites(DatabaseConstant.Action.KIEM_TRA, ApplicationConstant.FormatType.HOKHAU, txtSoHoKhau.Text, objType, ref resMessage, ref listClientResponseDetail);

                if (ret)
                {
                    //LMessage.ShowMessage("M.ResponseMessage.Common.NotExistSoHoKhau", LMessage.MessageBoxType.Information);
                    LMessage.ShowMessage(ApplicationConstant.layGiaTri(resMessage), LMessage.MessageBoxType.Information);
                }
                else
                {
                    LMessage.ShowMessage("M.ResponseMessage.Common.NoResponse", LMessage.MessageBoxType.Warning);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
Пример #2
0
        public bool Utilites(DatabaseConstant.Action action,
                             ApplicationConstant.FormatType type,
                             string value,
                             string objType,
                             ref ApplicationConstant.UtilitesResponseMessage responseMessage,
                             ref List <ClientResponseDetail> listClientResponseDetail)
        {
            // Kiểm tra kết nối, server, service trước khi request
            Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.UtilitiesService.layGiaTri());

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

            request.Action  = action;
            request.type    = type;
            request.value   = value;
            request.objType = objType;

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

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

            if (response != null && response.ResponseStatus == ApplicationConstant.ResponseStatus.THANH_CONG)
            {
                responseMessage          = response.utilitesResponseMessage;
                listClientResponseDetail = Common.Utilities.convertToClientResponseDetail(response);
                return(true);
            }
            else
            {
                return(false);
            }
        }