Пример #1
0
        public R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure WcGetNSS(bool YourDirty)
        {
            try
            {
                var InstanceLogin = new ATISWebMClassLoginManager();
                var InstanceTransportCompanies = new R2CoreTransportationAndLoadNotificationInstanceTransportCompaniesManager();
                var InstanceAnnouncementHalls  = new R2CoreTransportationAndLoadNotificationInstanceAnnouncementHallsManager();
                if (YourDirty)
                {
                    if (!(TxtnEstelamId.Text == string.Empty | TxtnEstelamId.Text == "0"))
                    {
                        throw new DataEntryException("از کلید ویرایش بار استفاده کنید");
                    }
                }
                else
                {
                    if (TxtnEstelamId.Text == string.Empty | TxtnEstelamId.Text == "0")
                    {
                        throw new DataEntryException("از کلید ثبت بار استفاده کنید");
                    }
                }

                if (TxtSearchLoad.Text == string.Empty)
                {
                    throw new DataEntryException("نوع بار انتخاب نشده است");
                }
                if (TxtSearchTargetCity.Text == string.Empty)
                {
                    throw new DataEntryException("مقصد انتخاب نشده است");
                }
                if (TxtSearchLoaderType.Text == string.Empty)
                {
                    throw new DataEntryException("بارگیر انتخاب نشده است");
                }
                if (TxtnCarNumKol.Text == string.Empty)
                {
                    throw new DataEntryException("تعداد بار نادرست است");
                }
                if (TxtTarrif.Text == string.Empty)
                {
                    TxtTarrif.Text = "0";
                }
                R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure NSS = null;
                if (TxtnEstelamId.Text != "0" & TxtnEstelamId.Text != string.Empty)
                {
                    NSS = new R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure(Convert.ToInt64(TxtnEstelamId.Text), string.Empty, TxtLoadReciever.Text, Convert.ToInt64(TxtSearchTargetCity.Text.Split('#')[0]), Convert.ToInt64(TxtSearchLoad.Text.Split('#')[0]), InstanceTransportCompanies.GetNSSTransportCompnay(InstanceLogin.GetNSSCurrentUser()).TCId, false, Convert.ToInt64(TxtSearchLoaderType.Text.Split('#')[0]), TxtAddress.Text, InstanceLogin.GetNSSCurrentUser().UserId, Convert.ToInt64(TxtnCarNumKol.Text), Convert.ToInt64(TxtTarrif.Text.Replace(",", "")), TxtDescription.Text, _DateTime.GetCurrentDateShamsiFull(), _DateTime.GetCurrentTime(), Convert.ToInt64(TxtnCarNumKol.Text), R2CoreTransportationAndLoadNotificationLoadCapacitorLoadStatuses.Registered, 21310000, InstanceAnnouncementHalls.GetNSSAnnouncementHallByLoaderTypeId(Convert.ToInt64(TxtSearchLoaderType.Text.Split('#')[0])).AHId, InstanceAnnouncementHalls.GetNSSAnnouncementHallSubGroupByLoaderTypeId(Convert.ToInt64(TxtSearchLoaderType.Text.Split('#')[0])).AHSGId);
                }
                else
                {
                    NSS = new R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure(0, string.Empty, TxtLoadReciever.Text, Convert.ToInt64(TxtSearchTargetCity.Text.Split('#')[0]), Convert.ToInt64(TxtSearchLoad.Text.Split('#')[0]), InstanceTransportCompanies.GetNSSTransportCompnay(InstanceLogin.GetNSSCurrentUser()).TCId, false, Convert.ToInt64(TxtSearchLoaderType.Text.Split('#')[0]), TxtAddress.Text, InstanceLogin.GetNSSCurrentUser().UserId, Convert.ToInt64(TxtnCarNumKol.Text), Convert.ToInt64(TxtTarrif.Text.Replace(",", "")), TxtDescription.Text, _DateTime.GetCurrentDateShamsiFull(), _DateTime.GetCurrentTime(), Convert.ToInt64(TxtnCarNumKol.Text), R2CoreTransportationAndLoadNotificationLoadCapacitorLoadStatuses.Registered, 21310000, InstanceAnnouncementHalls.GetNSSAnnouncementHallByLoaderTypeId(Convert.ToInt64(TxtSearchLoaderType.Text.Split('#')[0])).AHId, InstanceAnnouncementHalls.GetNSSAnnouncementHallSubGroupByLoaderTypeId(Convert.ToInt64(TxtSearchLoaderType.Text.Split('#')[0])).AHSGId);
                }
                return(NSS);
            }
            catch (PleaseReloginException ex)
            { Response.Redirect("/LoginManagement/Wflogin.aspx"); return(null); }
            catch (DataEntryException ex)
            { throw ex; }
            catch (Exception ex)
            { throw new Exception(MethodBase.GetCurrentMethod().ReflectedType.FullName + "\\n" + MethodBase.GetCurrentMethod().Name + "\\n" + ex.Message); }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         var InstanceLogin = new ATISWebMClassLoginManager();
         var InstanceTransportCompanies = new R2CoreTransportationAndLoadNotificationInstanceTransportCompaniesManager();
         R2CoreTransportationAndLoadNotificationStandardTransportCompanyStructure NSS = InstanceTransportCompanies.GetNSSTransportCompnay(InstanceLogin.GetNSSCurrentUser());
         TxtTransportCompanyTitle.Text = NSS.TCTitle.Trim();
     }
     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); }
 }
        public void WcViewInformation()
        {
            try
            {
                var InstanceLogin = new ATISWebMClassLoginManager();
                var InstanceTransportCompanies = new R2CoreTransportationAndLoadNotificationInstanceTransportCompaniesManager();
                var TCId = InstanceTransportCompanies.GetNSSTransportCompnay(InstanceLogin.GetNSSCurrentUser()).TCId;
                List <R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadExtendedStructure> Lst = null;
                if (WcCurrentListType == LoadCapacitorLoadsListType.NotSedimented)
                {
                    LblCaption.Text = "لیست بار موجود";
                    Lst             = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetNotSedimentedLoadCapacitorLoads(TCId);
                }
                else if (WcCurrentListType == LoadCapacitorLoadsListType.Sedimented)
                {
                    LblCaption.Text = "لیست بار رسوب شده";
                    Lst             = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetSedimentedLoadCapacitorLoads(TCId);
                }
                else if (WcCurrentListType == LoadCapacitorLoadsListType.TommorowLoad)
                {
                    LblCaption.Text = "لیست بار فردا";
                    Lst             = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetTommorowLoadCapacitorLoads(TCId);
                }
                else if (WcCurrentListType == LoadCapacitorLoadsListType.None)
                {
                    LblCaption.Text = "لیست بار";
                    Lst             = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetAllLoadCapacitorLoads(TCId);
                }

                DropDownListLoads.Items.Clear();
                DropDownListLoads.Items.Add("انتخاب کنید ...");
                for (int Loopx = 0; Loopx <= Lst.Count - 1; Loopx++)
                {
                    string Item = Lst[Loopx].nEstelamId + " # " + Lst[Loopx].GoodTitle + " " + Lst[Loopx].LoadTargetTitle;
                    DropDownListLoads.Items.Add(Item);
                }
            }
            catch (PleaseReloginException ex)
            { Response.Redirect("/LoginManagement/Wflogin.aspx"); }
            catch (Exception ex)
            { throw new Exception(MethodBase.GetCurrentMethod().ReflectedType.FullName + "." + MethodBase.GetCurrentMethod().Name + "." + ex.Message); }
        }
Пример #4
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); }
        }
        public void WcViewInformation()
        {
            try
            {
                var InstanceLogin = new ATISWebMClassLoginManager();
                var InstanceTransportCompanies = new R2CoreTransportationAndLoadNotificationInstanceTransportCompaniesManager();
                var TCId = InstanceTransportCompanies.GetNSSTransportCompnay(InstanceLogin.GetNSSCurrentUser()).TCId;
                List <R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadExtendedStructure> Lst = null;
                if (WcCurrentListType == LoadCapacitorLoadsListType.NotSedimented)
                {
                    LblCaption.Text = "لیست بار موجود";
                    Lst             = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetNotSedimentedLoadCapacitorLoads(TCId);
                }
                else if (WcCurrentListType == LoadCapacitorLoadsListType.Sedimented)
                {
                    LblCaption.Text = "لیست بار رسوب شده";
                    Lst             = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetSedimentedLoadCapacitorLoads(TCId);
                }
                else if (WcCurrentListType == LoadCapacitorLoadsListType.TommorowLoad)
                {
                    LblCaption.Text = "لیست بار فردا";
                    Lst             = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetTommorowLoadCapacitorLoads(TCId);
                }
                else if (WcCurrentListType == LoadCapacitorLoadsListType.None)
                {
                    LblCaption.Text = "لیست بار";
                    Lst             = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetAllLoadCapacitorLoads(TCId);
                }

                while (TblLoadCapacitorLoads.Rows.Count > 1)
                {
                    TblLoadCapacitorLoads.Rows.RemoveAt(1);
                }
                for (int Loopx = 0; Loopx <= Lst.Count - 1; Loopx++)
                {
                    TableRow  tempRow  = new TableRow();
                    TableCell tempCell = null;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].StrAddress; tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].StrBarName; tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].StrDescription; tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = R2CoreMClassPublicProcedures.ParseSignDigitToSignString(Lst[Loopx].StrPriceSug); tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].nCarNum.ToString(); tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].nCarNumKol.ToString(); tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].LoaderTypeTitle; tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].LoadTargetTitle; tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].GoodTitle; tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].dDateElam + " - " + Lst[Loopx].dTimeElam; tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    tempCell      = new TableCell();
                    tempCell.Text = Lst[Loopx].nEstelamId.ToString(); tempCell.CssClass = "R2FontBHomaSmall"; tempRow.Cells.Add(tempCell); tempCell.HorizontalAlign = HorizontalAlign.Center;
                    TblLoadCapacitorLoads.Rows.Add(tempRow);
                }
                TableFooterRow tempFooterRow = new TableFooterRow();
                tempFooterRow.BackColor   = Color.LightBlue;
                tempFooterRow.BorderColor = Color.LightBlue;
                TblLoadCapacitorLoads.Rows.Add(tempFooterRow);
            }
            catch (PleaseReloginException ex)
            { Response.Redirect("/LoginManagement/Wflogin.aspx"); }
            catch (Exception ex)
            { throw new Exception(MethodBase.GetCurrentMethod().ReflectedType.FullName + "." + MethodBase.GetCurrentMethod().Name + "." + ex.Message); }
        }