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); } }
public void UCViewInformation(R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure YourNSS) { try { LblnEstelamId.Text = YourNSS.nEstelamId.ToString(); LblDateElam.Text = YourNSS.dDateElam + "-" + YourNSS.dTimeElam; TxtStrBarName.Text = YourNSS.StrBarName; TxtSearchTarget.Text = YourNSS.nCityCode.ToString(); TxtSearchGood.Text = YourNSS.nBarCode.ToString(); TxtSearchLoaderType.Text = YourNSS.nTruckType.ToString(); TxtAddress.Text = YourNSS.StrAddress; TxtnCarNumKol.Text = YourNSS.nCarNumKol.ToString(); TxtTarrif.Text = YourNSS.StrPriceSug.ToString(); TxtDescription.Text = YourNSS.StrDescription; UCViewInformationCompleted?.Invoke(this, new EventArgs()); } catch (Exception ex) { throw new Exception(MethodBase.GetCurrentMethod().ReflectedType.FullName + "." + MethodBase.GetCurrentMethod().Name + "/n/r" + ex.Message); } }
public R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure UCGetInformation(bool YourDirty) { try { if ((!YourDirty) & (LblnEstelamId.Text == string.Empty | LblnEstelamId.Text == "0")) { throw new Exception("بار انتخاب نشده است"); } if (DropDownListGoods.SelectedIndex < 0) { throw new Exception("نوع بار انتخاب نشده است"); } if (DropDownListTargets.SelectedIndex < 0) { throw new Exception("مقصد انتخاب نشده است"); } if (DropDownListLoaderType.SelectedIndex < 0) { throw new Exception("بارگیر انتخاب نشده است"); } if (TxtnCarNumKol.Text == string.Empty) { throw new Exception("تعداد بار نادرست است"); } if (TxtTarrif.Text == string.Empty) { TxtTarrif.Text = "0"; } R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure NSS = null; if (LblnEstelamId.Text != "0" & LblnEstelamId.Text != string.Empty) { NSS = new R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure(Convert.ToInt64(LblnEstelamId.Text), TxtStrBarName.Text, Convert.ToInt64(DropDownListTargets.Text.Split(' ')[0]), Convert.ToInt64(DropDownListGoods.Text.Split(' ')[0]), R2CoreTransportationAndLoadNotificationMClassTransportCompaniesManagement.GetNSSTransportCompnay(R2Core.UserManagement.R2CoreMClassLoginManagement.CurrentUserNSS).TCId, Convert.ToInt64(DropDownListLoaderType.Text.Split(' ')[0]), TxtAddress.Text, R2CoreMClassLoginManagement.CurrentUserNSS.UserId, Convert.ToInt64(TxtnCarNumKol.Text), Convert.ToInt64(TxtTarrif.Text.Replace(",", "")), TxtDescription.Text, _DateTime.GetCurrentDateShamsiFull(), _DateTime.GetCurrentTime(), Convert.ToInt64(TxtnCarNumKol.Text), R2CoreTransportationAndLoadNotificationLoadCapacitorLoadStatuses.Registered, 21310000, R2CoreTransportationAndLoadNotificationMClassAnnouncementHallsManagement.GetNSSAnnouncementHallByLoaderTypeId(Convert.ToInt64(DropDownListLoaderType.Text.Split(' ')[0])).AHId, R2CoreTransportationAndLoadNotificationMClassAnnouncementHallsManagement.GetNSSAnnouncementHallSubGroupByLoaderTypeId(Convert.ToInt64(DropDownListLoaderType.Text.Split(' ')[0])).AHSGId); } else { NSS = new R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure(0, TxtStrBarName.Text, Convert.ToInt64(DropDownListTargets.Text.Split(' ')[0]), Convert.ToInt64(DropDownListGoods.Text.Split(' ')[0]), R2CoreTransportationAndLoadNotificationMClassTransportCompaniesManagement.GetNSSTransportCompnay(R2Core.UserManagement.R2CoreMClassLoginManagement.CurrentUserNSS).TCId, Convert.ToInt64(DropDownListLoaderType.Text.Split(' ')[0]), TxtAddress.Text, R2CoreMClassLoginManagement.CurrentUserNSS.UserId, Convert.ToInt64(TxtnCarNumKol.Text), Convert.ToInt64(TxtTarrif.Text.Replace(",", "")), TxtDescription.Text, _DateTime.GetCurrentDateShamsiFull(), _DateTime.GetCurrentTime(), Convert.ToInt64(TxtnCarNumKol.Text), R2CoreTransportationAndLoadNotificationLoadCapacitorLoadStatuses.Registered, 21310000, R2CoreTransportationAndLoadNotificationMClassAnnouncementHallsManagement.GetNSSAnnouncementHallByLoaderTypeId(Convert.ToInt64(DropDownListLoaderType.Text.Split(' ')[0])).AHId, R2CoreTransportationAndLoadNotificationMClassAnnouncementHallsManagement.GetNSSAnnouncementHallSubGroupByLoaderTypeId(Convert.ToInt64(DropDownListLoaderType.Text.Split(' ')[0])).AHSGId); } return(NSS); } catch (Exception ex) { throw ex; } }
protected void BtnRegistering_Click(object sender, EventArgs e) { try { R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure NSS = UCGetInformation(true); if (NSS.nEstelamId != 0) { R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManipulationManagement.LoadCapacitorLoadEditing(NSS); } else { long mynEstelamId = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManipulationManagement.LoadCapacitorLoadRegistering(NSS); UCViewInformation(R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetNSSLoadCapacitorLoad(mynEstelamId)); } UCInformationChangedEvent?.Invoke(this, new EventArgs()); } catch (Exception ex) { Response.Write("<script>alert('" + ex.Message + "')</script>"); } }
protected void BtnDeleting_Click(object sender, EventArgs e) { try { R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure NSS = UCGetInformation(false); if (NSS.nEstelamId != 0) { R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManipulationManagement.LoadCapacitorLoadDeleting(NSS.nEstelamId); UCRefreshInformation(); UCInformationChangedEvent?.Invoke(this, new EventArgs()); } } catch (Exception ex) { Response.Write("<script>alert('" + ex.Message + "')</script>"); } }
private void BtnLoadCancelling_Click(object sender, EventArgs e) { try { var InstanceLogin = new ATISWebMClassLoginManager(); var InstanceLoadCapacitorLoadManipulation = new R2CoreTransportationAndLoadNotificationInstanceLoadCapacitorLoadManipulationManager(); R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure NSSTemp = WcGetNSS(false); R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure NSS = R2CoreTransportationAndLoadNotificationMClassLoadCapacitorLoadManagement.GetNSSLoadCapacitorLoad(NSSTemp.nEstelamId); if (NSS.nEstelamId != 0) { InstanceLoadCapacitorLoadManipulation.LoadCapacitorLoadCancelling(NSS, InstanceLogin.GetNSSCurrentUser()); WcRefreshInformation(); WcInformationChangedEvent?.Invoke(this, new EventArgs()); Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('2','" + "بار با موفقیت کنسل شد" + "');", true); } } catch (PleaseReloginException ex) { Response.Redirect("/LoginManagement/Wflogin.aspx"); } catch (LoadCapacitorLoadCancelTimeNotReachedException ex) { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + ex.Message + "');", true); } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + MethodBase.GetCurrentMethod().ReflectedType.FullName + "." + MethodBase.GetCurrentMethod().Name + "\\n" + ex.Message + "');", true); } }
private void BtnLoadEditing_Click(object sender, EventArgs e) { try { var InstanceLogin = new ATISWebMClassLoginManager(); var InstanceLoadCapacitorLoadManipulation = new R2CoreTransportationAndLoadNotificationInstanceLoadCapacitorLoadManipulationManager(); var InstanceLoadCapacitorLoad = new R2CoreTransportationAndLoadNotificationInstanceLoadCapacitorLoadManager(); R2CoreTransportationAndLoadNotificationStandardLoadCapacitorLoadStructure NSS = WcGetNSS(false); InstanceLoadCapacitorLoadManipulation.LoadCapacitorLoadEditing(NSS, InstanceLogin.GetNSSCurrentUser()); WcViewInformation(InstanceLoadCapacitorLoad.GetNSSLoadCapacitorLoad(NSS.nEstelamId)); WcInformationChangedEvent?.Invoke(this, new EventArgs()); Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('2','" + "ویرایش بار با موفقیت انجام شد" + "');", true); } catch (SqlInjectionException ex) { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + ex.Message + "');", true); } catch (PleaseReloginException ex) { Response.Redirect("/LoginManagement/Wflogin.aspx"); } catch (Exception ex) when(ex is LoadCapacitorLoadRegisteringNotAllowedforThisAnnouncementHallSubGroupException || ex is LoadCapacitorLoadNumberOverLimitException || ex is LoadCapacitorLoadnCarNumKolCanNotBeZeroException || ex is TransportCompanyISNotActiveException || ex is LoadCapacitorLoadRegisterTimePassedException || ex is LoadCapacitorLoadEditTimePassedException) { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + ex.Message + "');", true); } catch (Exception ex) when(ex is LoadCapacitorLoadHandlingNotAllowedBecuaseLoadStatusException || ex is LoadCapacitorLoadNotFoundException || ex is LoadCapacitorLoadEditingChangeAHIdNotAllowedException || ex is LoaderTypeRelationAnnouncementHallNotFoundException || ex is LoaderTypeRelationAnnouncementHallSubGroupNotFoundException) { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + ex.Message + "');", true); } catch (DataEntryException ex) { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + ex.Message + "');", true); } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(GetType(), "WcViewAlert", "WcViewAlert('1','" + MethodBase.GetCurrentMethod().ReflectedType.FullName + "." + MethodBase.GetCurrentMethod().Name + " \\n " + ex.Message + "');", true); } }