public HttpResponseMessage LoadAllocationAgent()
        {
            ATISMobileWebApi WebAPi = new ATISMobileWebApi();

            try
            {
                //تایید اعتبار کلاینت
                WebAPi.AuthenticateClientApikeyNoncePersonalNonceWith1Parameter(Request, ATISMobileWebApiLogTypes.WebApiClientLoadAllocationRegisteringRequest);

                var NSSSoftwareuser       = WebAPi.GetNSSSoftwareUser(Request);
                var InstanceConfiguration = new R2CoreInstanceConfigurationManager();
                var InstanceSoftwareusers = new R2CoreInstanseSoftwareUsersManager();
                var InstanceAES           = new AESAlgorithmsManager();
                var Content      = JsonConvert.DeserializeObject <string>(Request.Content.ReadAsStringAsync().Result);
                var MobileNumber = InstanceAES.Decrypt(Content.Split(';')[0], InstanceConfiguration.GetConfigString(R2CoreConfigurations.PublicSecurityConfiguration, 3));
                var nEstelamId   = Convert.ToInt64(Content.Split(';')[2]);
                var InstanceLoadCapacitorLoad = new R2CoreTransportationAndLoadNotificationInstanceLoadCapacitorLoadManager();
                var NSSLoadCapacitorLoad      = InstanceLoadCapacitorLoad.GetNSSLoadCapacitorLoad(InstanceLoadCapacitorLoad.GetNSSLoadCapacitorLoad(nEstelamId).nEstelamKey);

                Int64 myTurnId = Int64.MinValue;
                try
                {
                    var InstanceTurns = new R2CoreTransportationAndLoadNotificationInstanceTurnsManager();
                    myTurnId = InstanceTurns.GetNSSTurn(NSSSoftwareuser).nEnterExitId;
                }
                catch (Exception ex)
                { throw ex; }

                var   InstanceLoadAllocation = new R2CoreTransportationAndLoadNotificationInstanceLoadAllocationManager();
                Int64 LAId = InstanceLoadAllocation.LoadAllocationRegistering(NSSLoadCapacitorLoad.nEstelamId, myTurnId, NSSSoftwareuser, R2CoreTransportationAndLoadNotificationRequesters.ATISRestfullLoadAllocationRegisteringAgent);
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
                return(response);
            }
            catch (LoadAllocationNotAllowedBecauseCarHasBlackListException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (LoadAllocationRegisteringReachedEndTimeException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (RequesterHasNotPermissionforLoadAllocationRegisteringException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (LoadCapacitorLoadNotFoundException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (LoadAllocationNotAllowedBecuaseAHSGLoadAllocationIsUnactiveException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (TurnNotFoundException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserNotExistByApiKeyException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (TruckDriverNotFoundException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserLast5DigitNotMatchingException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserIdNotExistException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }
        public HttpResponseMessage GetLoadPermissionsViaLicensePlate()
        {
            ATISMobileWebApi WebAPi = new ATISMobileWebApi();

            try
            {
                //تایید اعتبار کلاینت
                WebAPi.AuthenticateClientApikeyNonceWith2Parameter(Request, ATISMobileWebApiLogTypes.WebApiClientGetLoadPermissionsViaLicensePlate);

                var NSSSoftwareuser       = WebAPi.GetNSSSoftwareUser(Request);
                var InstanceConfiguration = new R2CoreInstanceConfigurationManager();
                var InstanceSoftwareusers = new R2CoreInstanseSoftwareUsersManager();
                var InstanceAES           = new AESAlgorithmsManager();
                var Content      = JsonConvert.DeserializeObject <string>(Request.Content.ReadAsStringAsync().Result);
                var MobileNumber = InstanceAES.Decrypt(Content.Split(';')[0], InstanceConfiguration.GetConfigString(R2CoreConfigurations.PublicSecurityConfiguration, 3));
                var LPPelak      = Content.Split(';')[2];
                var LPSerial     = Content.Split(';')[3];

                var InstanceLoadAllocation = new R2CoreTransportationAndLoadNotificationInstanceLoadAllocationManager();
                List <Models.LoadAllocationsforTruckDriver> _LoadAllocations = new List <Models.LoadAllocationsforTruckDriver>();
                var           Lst = InstanceLoadAllocation.GetLoadPermissionsViaLicensePlate(LPPelak, LPSerial);
                StringBuilder SB  = new StringBuilder();
                for (int Loopx = 0; Loopx <= Lst.Count - 1; Loopx++)
                {
                    var Item = new Models.LoadAllocationsforTruckDriver();
                    SB.Clear();
                    SB.Append("شرکت حمل و نقل: " + Lst[Loopx].TransportCompanyTitle.Trim() + " " + Lst[Loopx].TransportCompanyTel.Trim() + "\r\n");
                    SB.Append("کد مرجع: " + Lst[Loopx].LoadCapacitorLoadnEstelamId + "\r\n");
                    SB.Append(Lst[Loopx].LoadCapacitorLoadGoodTitle.Trim() + " " + Lst[Loopx].LoadCapacitorLoadTargetTitle.Trim() + " تعدادبار: " + Lst[Loopx].LoadCapacitorLoadnCarNumKol.Trim() + "\r\n");
                    SB.Append("تعرفه: " + Lst[Loopx].LoadCapacitorLoadStrPriceSug.Trim() + "\r\n");
                    SB.Append("توضیحات بار: " + Lst[Loopx].LoadCapacitorLoadStrDescription.Trim() + " " + Lst[Loopx].LoadCapacitorLoadStrBarName.Trim() + " " + Lst[Loopx].LoadCapacitorLoadStrAddress.Trim() + "\r\n");
                    SB.Append("وضعیت تخصیص بار: " + Lst[Loopx].LoadAllocationStatusTitle.Trim() + "\r\n");
                    SB.Append("تاریخ تخصیص بار: " + Lst[Loopx].LoadPermissionDate + " - " + Lst[Loopx].LoadPermissionTime + "\r\n");
                    SB.Append("توضیحات تخصیص: " + Lst[Loopx].LoadAllocationNote.Trim() + "\r\n");
                    SB.Append("طول سفر: " + Lst[Loopx].LoadCapacitorLoadTargetTravelength.Trim() + "\r\n");
                    Item.Description      = SB.ToString();
                    Item.DescriptionColor = Lst[Loopx].LoadAllocationStatusColor;
                    Item.LoadAllocationId = "شماره تخصیص:" + Lst[Loopx].LoadAllocationId + " - " + "اولویت:" + Lst[Loopx].LoadAllocationPriority;
                    _LoadAllocations.Add(Item);
                }
                HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(_LoadAllocations), Encoding.UTF8, "application/json");
                return(response);
            }
            catch (UserNotExistByApiKeyException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (LoadAllocationNotFoundException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }
 private void AuthorizationLoadAllocationIdWithSoftwareUser(R2CoreStandardSoftwareUserStructure YourNSSSoftwareUser, Int64 YourLoadAllocationId)
 {
     try
     {
         var InstanceLoadAllocation = new R2CoreTransportationAndLoadNotificationInstanceLoadAllocationManager();
         var InstanceTurn           = new R2CoreTransportationAndLoadNotificationInstanceTurnsManager();
         if (InstanceTurn.GetNSSTurn(YourNSSSoftwareUser).nEnterExitId != InstanceLoadAllocation.GetNSSLoadAllocation(YourLoadAllocationId).TurnId)
         {
             throw new LoadAllocationIdNotPairWithDriverException();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Ejemplo n.º 4
0
        private void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                var InstanceLoadAllocation = new R2CoreTransportationAndLoadNotificationInstanceLoadAllocationManager();
                List <R2CoreTransportationAndLoadNotificationStandardLoadAllocationExtendedforTruckDriverStructure> _LoadAllocations = new List <R2CoreTransportationAndLoadNotificationStandardLoadAllocationExtendedforTruckDriverStructure>();
                var Lst = InstanceLoadAllocation.GetLoadPermissionsViaLicensePlate("539ع24", "83");

                //var InstanceSequentialTrun = new R2CoreTransportationAndLoadNotificationInstanceSequentialTurnsManager();
                //PayanehClassLibraryMClassCarTruckNobatManagement.TurnsCancellation("9:943623", InstanceSequentialTrun.GetNSSSequentialTurn(2), "1400");

                //var listOfStrings = new string[] { "as", "AS" };
                //var myString = "AsDFG";
                //bool b = listOfStrings.Any(s => myString.IndexOf(s, StringComparison.OrdinalIgnoreCase) >= 0);
                //listOfStrings.Any(s => s.Equals(myString, StringComparison.OrdinalIgnoreCase));

                //var InstanceCaptcha = new R2CoreInstanceCaptchaManager();
                //var FakeWord = InstanceCaptcha.GenerateFakeWordNumeric(5);
                //var CaptchaImage = InstanceCaptcha.GenerateCaptcha(FakeWord);
                //pictureBox1.Image = CaptchaImage;
                //  var InstanceReport = new R2CoreTransportationAndLoadNotificationInstanceLoadPermissionManager();
                //var Lst=  InstanceReport.ReportingInformationProviderLoadPermissionsIssuedOrderByPriorityReport(7);
                //  List<PermissionsIssued> _PermissionsIssued = new List<PermissionsIssued>();
                //  for (int Loopx = 0; Loopx <= Lst.Count - 1; Loopx++)
                //  {
                //      var Item = new PermissionsIssued();
                //      //Item.ReportItem = Lst[Loopx];
                //      _PermissionsIssued.Add(Item);
                //  }

                //var InstanceSoftwareUsers = new R2CoreInstanseSoftwareUsersManager();
                //var InstanceLoadAllocation = new R2CoreTransportationAndLoadNotificationInstanceLoadAllocationManager();

                //var Lst = InstanceLoadAllocation.GetLoadAllocationsforTruckDriver(InstanceSoftwareUsers.GetNSSUser("50299aa592ccef6eaa8b603bc587192e").UserId);


                //var InstanceLoadCapacitorLoad = new  R2CoreTransportationAndLoadNotificationInstanceLoadCapacitorLoadManager();

                //var Lst = InstanceLoadCapacitorLoad.GetLoadCapacitorLoads(Convert.ToInt64("2"), Convert.ToInt64("7"), 4, false, true, R2CoreTransportationAndLoadNotificationLoadCapacitorLoadOrderingOptions.TargetProvince, Int64.MinValue, Convert.ToInt64("11"));

                //StringBuilder hash = new StringBuilder();
                //MD5CryptoServiceProvider md5provider = new MD5CryptoServiceProvider();
                //byte[] bytes = md5provider.ComputeHash(new UTF8Encoding().GetBytes("0D992C8C-3F8A-428A-8638-25B94D04BEA7" + ":" + DateTime.Now.Day));
                //for (int i = 0; i < bytes.Length; i++)
                //{ hash.Append(bytes[i].ToString("x2")); }
                //var x = hash.ToString();
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }
        }
        public HttpResponseMessage LoadAllocationCancelling()
        {
            ATISMobileWebApi WebAPi = new ATISMobileWebApi();

            try
            {
                //تایید اعتبار کلاینت
                WebAPi.AuthenticateClientApikeyNoncePersonalNonceWith1Parameter(Request, ATISMobileWebApiLogTypes.WebApiClientLoadAllocationCancellingRequest);

                var InstanceConfiguration = new R2CoreInstanceConfigurationManager();
                var InstanceSoftwareusers = new R2CoreInstanseSoftwareUsersManager();
                var InstanceAES           = new AESAlgorithmsManager();
                var Content          = JsonConvert.DeserializeObject <string>(Request.Content.ReadAsStringAsync().Result);
                var MobileNumber     = InstanceAES.Decrypt(Content.Split(';')[0], InstanceConfiguration.GetConfigString(R2CoreConfigurations.PublicSecurityConfiguration, 3));
                var NSSSoftwareuser  = InstanceSoftwareusers.GetNSSUser(new R2CoreSoftwareUserMobile(MobileNumber));
                var LoadAllocationId = Convert.ToInt64(Content.Split(';')[2]);
                AuthorizationLoadAllocationIdWithSoftwareUser(NSSSoftwareuser, LoadAllocationId);
                var InstanceLoadAllocation = new R2CoreTransportationAndLoadNotificationInstanceLoadAllocationManager();
                InstanceLoadAllocation.LoadAllocationCancelling(LoadAllocationId, R2CoreTransportationAndLoadNotificationLoadAllocationStatuses.CancelledUser, NSSSoftwareuser);
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
                return(response);
            }
            catch (TimingNotReachedException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (TurnHandlingNotAllowedBecuaseTurnStatusException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (LoadAllocationCancellingNotAllowedBecauseLoadAllocationStatusException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (LoadAllocationCancellingNotAllowedBecauseTurnStatusException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserNotExistByApiKeyException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserLast5DigitNotMatchingException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserIdNotExistException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (LoadAllocationNotFoundException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (LoadCapacitorLoadNotFoundException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (TurnNotFoundException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }
        public HttpResponseMessage GetLoadAllocationsforTruckDriver()
        {
            ATISMobileWebApi WebAPi = new ATISMobileWebApi();

            try
            {
                //تایید اعتبار کلاینت
                WebAPi.AuthenticateClientApikeyNonce(Request, ATISMobileWebApiLogTypes.WebApiClientLoadAllocationsRequest);

                var NSSSoftwareuser        = WebAPi.GetNSSSoftwareUser(Request);
                var InstanceLoadAllocation = new R2CoreTransportationAndLoadNotificationInstanceLoadAllocationManager();
                List <Models.LoadAllocationsforTruckDriver> _LoadAllocations = new List <Models.LoadAllocationsforTruckDriver>();
                var           Lst = InstanceLoadAllocation.GetLoadAllocationsforTruckDriver(NSSSoftwareuser.UserId);
                StringBuilder SB  = new StringBuilder();
                for (int Loopx = 0; Loopx <= Lst.Count - 1; Loopx++)
                {
                    var Item = new Models.LoadAllocationsforTruckDriver();
                    SB.Clear();
                    SB.Append("شرکت حمل و نقل: " + Lst[Loopx].TransportCompanyTitle.Trim() + " " + Lst[Loopx].TransportCompanyTel.Trim() + "\r\n");
                    SB.Append("کد مرجع: " + Lst[Loopx].LoadCapacitorLoadnEstelamId + "\r\n");
                    SB.Append(Lst[Loopx].LoadCapacitorLoadGoodTitle.Trim() + " " + Lst[Loopx].LoadCapacitorLoadTargetTitle.Trim() + " تعدادبار: " + Lst[Loopx].LoadCapacitorLoadnCarNumKol.Trim() + "\r\n");
                    SB.Append("تعرفه: " + Lst[Loopx].LoadCapacitorLoadStrPriceSug.Trim() + "\r\n");
                    SB.Append("توضیحات بار: " + Lst[Loopx].LoadCapacitorLoadStrDescription.Trim() + " " + Lst[Loopx].LoadCapacitorLoadStrBarName.Trim() + " " + Lst[Loopx].LoadCapacitorLoadStrAddress.Trim() + "\r\n");
                    SB.Append("وضعیت تخصیص بار: " + Lst[Loopx].LoadAllocationStatusTitle.Trim() + "\r\n");
                    SB.Append("توضیحات تخصیص: " + Lst[Loopx].LoadAllocationNote.Trim() + "\r\n");
                    SB.Append("طول سفر: " + Lst[Loopx].LoadCapacitorLoadTargetTravelength.Trim() + "\r\n");
                    Item.Description      = SB.ToString();
                    Item.DescriptionColor = Lst[Loopx].LoadAllocationStatusColor;
                    Item.LoadAllocationId = "شماره تخصیص:" + Lst[Loopx].LoadAllocationId + " - " + "اولویت:" + Lst[Loopx].LoadAllocationPriority;
                    _LoadAllocations.Add(Item);
                }
                HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(_LoadAllocations), Encoding.UTF8, "application/json");
                return(response);
            }
            catch (UserNotExistByApiKeyException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (LoadAllocationNotFoundException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }
Ejemplo n.º 7
0
        private void BtnLoadAllocation_Click(object sender, EventArgs e)
        {
            R2CoreTransportationAndLoadNotificationStandardTurnStructure NSSTurn = null;
            var InstanceCarTruckNobat = new PayanehClassLibraryMClassCarTruckNobatManager();
            var InstanceLogin         = new ATISWebMClassLoginManager();

            try
            {
                BtnLoadAllocation.Enabled = false;
                var InstanceTransportCompanies = new R2CoreTransportationAndLoadNotificationInstanceTransportCompaniesManager();
                var NSSTruck             = WcSmartCardsInquiry.WcGetNSSTruck;
                var NSSTruckDriver       = WcSmartCardsInquiry.WcGetNSSTruckDriver;
                var NSSTransportCompany  = InstanceTransportCompanies.GetNSSTransportCompnay(InstanceLogin.GetNSSCurrentUser());
                var NSSLoadCapacitorLoad = WcViewerNSSLoadCapacitorLoad.WcGetNSSCurrent;

                //به دست آوردن نوبت موجود ناوگان و یا این که در صورت عدم وجود نوبت باید روابط موقت ایجاد گردد و نوبت صادر گردد
                //در این جا از کیف پول شرکت حمل و نقل استفاده شده است
                //سه رابطه ایجاد می گردد ناوگان-راننده و ناوگان-زیرگروه اعلام بار و ناوگان-کیف پول
                var InstanceTurns  = new R2CoreTransportationAndLoadNotificationInstanceTurnsManager();
                var TempTurnReport = string.Empty;
                try
                {
                    NSSTurn                 = InstanceTurns.GetNSSTurn(NSSTruck);
                    TempTurnReport          = "ناوگان نوبت دارد.برای تخصیص بار از نوبت موجود استفاده شد ";
                    PnlTurnStatus.BackColor = System.Drawing.Color.Green;
                }
                catch (TurnNotFoundException ex)
                {
                    NSSTurn                 = InstanceTurns.GetNSSTurn(InstanceCarTruckNobat.GetTurnofKiosk(NSSTruck, NSSTruckDriver, NSSTransportCompany, NSSLoadCapacitorLoad, InstanceLogin.GetNSSCurrentUser()));
                    TempTurnReport          = "ناوگان نوبت ندارد.نوبت به صورت خودکار در سامانه صادر شد ";
                    PnlTurnStatus.BackColor = System.Drawing.Color.Red;
                }
                //تخصیص بار - آزاد سازی بار به صورت خودکار توسط سرور انجام می گردد
                //مشاهده و چاپ مجوز از طریق قسمت مجوزهای صادر شده در بارهای رسوبی قابل مشاهده است
                var   InstanceLoadAllocation = new R2CoreTransportationAndLoadNotificationInstanceLoadAllocationManager();
                Int64 LAId = InstanceLoadAllocation.LoadAllocationRegistering(NSSLoadCapacitorLoad.nEstelamId, NSSTurn.nEnterExitId, InstanceLogin.GetNSSCurrentUser(), R2CoreTransportationAndLoadNotificationRequesters.WcLoadCapacitorLoadAllocationLoadPermissionIssue);
                LblTurnStatus.Text = TempTurnReport;
                Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('2','تخصیص بار با موفقیت انجام شد');", true);
            }
            catch (Exception ex) when(ex is SoftwareUserMoneyWalletNotFoundException ||
                                      ex is MoneyWalletCurrentChargeNotEnoughException ||
                                      ex is TurnRegisterRequestTypeNotFoundException ||
                                      ex is CarIsNotPresentInParkingException ||
                                      ex is SequentialTurnIsNotActiveException ||
                                      ex is TurnPrintingInfNotFoundException ||
                                      ex is GetNobatExceptionCarTruckIsTankTreiler ||
                                      ex is CarTruckTravelLengthNotOverYetException ||
                                      ex is GetNobatExceptionCarTruckHasNobat ||
                                      ex is GetNobatException ||
                                      ex is GetNSSException ||
                                      ex is TruckRelatedSequentialTurnNotFoundException ||
                                      ex is TransportCompanyNotFoundException ||
                                      ex is LoadCapacitorLoadNotFoundException ||
                                      ex is DataEntryException ||
                                      ex is AnnouncementHallSubGroupUnActiveException ||
                                      ex is AnnouncementHallSubGroupRelationTruckNotExistException ||
                                      ex is AnnouncementHallSubGroupNotFoundException ||
                                      ex is LoadAllocationRegisteringReachedEndTimeException ||
                                      ex is LoadAllocationMaximumAllowedNumberReachedException ||
                                      ex is LoadCapacitorLoadAHSGIdViaTruckAHSGIdNotAllowedException ||
                                      ex is LoadAllocationRegisteringFailedBecauseLoadCapacitorLoadIsNotReadyException ||
                                      ex is LoadAllocationRegisteringFailedBecauseTurnIsNotReadyException ||
                                      ex is LoadCapacitorLoadLoaderTypeViaSequentialTurnOfTurnNotAllowedException ||
                                      ex is LoadAllocationNotAllowedBecuaseAHSGLoadAllocationIsUnactiveException ||
                                      ex is LoadCapacitorLoadHandlingNotAllowedBecuaseLoadStatusException ||
                                      ex is RegisteredLoadAllocationIsRepetitiousException ||
                                      ex is RequesterHasNotPermissionforLoadAllocationRegisteringException ||
                                      ex is LoadAllocationNotAllowedBecauseCarHasBlackListException ||
                                      ex is TimingNotReachedException ||
                                      ex is TurnNotFoundException ||
                                      ex is TruckNotFoundException ||
                                      ex is TurnHandlingNotAllowedBecuaseTurnStatusException ||
                                      ex is UnableAllocatingTommorowLoadException ||
                                      ex is RequesterNotAllowTurnIssueBySeqTException ||
                                      ex is RequesterNotAllowTurnIssueByLastLoadPermissionedException ||
                                      ex is LoadCapacitorLoadNotFoundException)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + ex.Message.Replace("\r\n", " ") + "');", true);
            }
            catch (PleaseReloginException ex)
            { Response.Redirect("/LoginManagement/Wflogin.aspx"); }
            catch (Exception ex)
            { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + MethodBase.GetCurrentMethod().ReflectedType.FullName + "." + MethodBase.GetCurrentMethod().Name + "." + ex.Message + "');", true); }
        }