Exemple #1
0
        private void LoadValuesFromSession()
        {
            if (this.Session["Product"] == null)
            {
                return;
            }

            this.model = this.Session["Product"] as MergeModel;

            if (this.model == null)
            {
                return;
            }

            this.PartyCodeHidden.Value   = this.model.PartyCode.ToString(LocalizationHelper.GetCurrentCulture());
            this.PartyCodeTextBox.Text   = this.model.PartyCode.ToString(LocalizationHelper.GetCurrentCulture());
            this.PriceTypeIdHidden.Value = this.model.PriceTypeId.ToString(SessionHelper.GetCulture());

            this.ReferenceNumberTextBox.Text    = this.model.ReferenceNumber;
            this.StatementReferenceTextBox.Text = this.model.StatementReference;

            this.Session[this.ID]             = this.model.View;
            TranIdCollectionHiddenField.Value = string.Join(",", this.model.TransactionIdCollection);
            this.ClearSession("Product");
        }
Exemple #2
0
        public override void OnControlLoad(object sender, EventArgs e)
        {
            using (ScrudForm scrud = new ScrudForm())
            {
                scrud.DenyAdd    = !SessionHelper.IsAdmin();
                scrud.DenyEdit   = !SessionHelper.IsAdmin();
                scrud.DenyDelete = !SessionHelper.IsAdmin();

                scrud.KeyColumn = "user_id";

                scrud.TableSchema = "policy";
                scrud.Table       = "auto_verification_policy";
                scrud.ViewSchema  = "policy";
                scrud.View        = "auto_verification_policy_scrud_view";

                scrud.PageSize = 100;

                scrud.DisplayFields = GetDisplayFields();
                scrud.DisplayViews  = GetDisplayViews();

                scrud.Text             = Titles.AutoVerificationPolicy;
                scrud.ResourceAssembly = Assembly.GetAssembly(typeof(AutoVerification));

                this.ScrudPlaceholder.Controls.Add(scrud);
            }

            base.OnControlLoad(sender, e);
        }
Exemple #3
0
        public Collection <ListItem> GetAccounts()
        {
            if (Switches.AllowParentAccountInGlTransaction())
            {
                if (SessionHelper.IsAdmin())
                {
                    using (DataTable table = Accounts.GetAccounts())
                    {
                        return(GetValues(table));
                    }
                }

                using (DataTable table = Accounts.GetNonConfidentialAccounts())
                {
                    return(GetValues(table));
                }
            }

            if (SessionHelper.IsAdmin())
            {
                using (DataTable table = Accounts.GetChildAccounts())
                {
                    return(GetValues(table));
                }
            }

            using (DataTable table = Accounts.GetNonConfidentialChildAccounts())
            {
                return(GetValues(table));
            }
        }
Exemple #4
0
        public Collection <ListItem> GetCashRepositories()
        {
            Collection <ListItem> values = new Collection <ListItem>();

            int officeId = SessionHelper.GetOfficeId();

            using (DataTable table = CashRepositories.GetCashRepositoryDataTable(officeId))
            {
                string displayField = ConfigurationHelper.GetDbParameter("CashRepositoryDisplayField");
                table.Columns.Add("cash_repository", typeof(string), displayField);

                foreach (DataRow dr in table.Rows)
                {
                    values.Add(new ListItem(dr["cash_repository"].ToString(), dr["cash_repository_id"].ToString()));
                }
            }
            return(values);
        }
Exemple #5
0
 public static string GetRole()
 {
     return(Conversion.TryCastString(SessionHelper.GetSessionKey("Role")));
 }
Exemple #6
0
 public static string GetRegistrationNumber()
 {
     return(Conversion.TryCastString(SessionHelper.GetSessionKey("RegistrationNumber")));
 }
Exemple #7
0
 public static DateTime GetRegistrationDate()
 {
     return(Conversion.TryCastDate(SessionHelper.GetSessionKey("RegistrationDate")));
 }
Exemple #8
0
 public static string GetOfficeName()
 {
     return(Conversion.TryCastString(SessionHelper.GetSessionKey("OfficeName")));
 }
Exemple #9
0
 public static string GetZipCode()
 {
     return(Conversion.TryCastString(SessionHelper.GetSessionKey("ZipCode")));
 }
Exemple #10
0
 public static int GetOfficeId()
 {
     return(Conversion.TryCastInteger(SessionHelper.GetSessionKey("OfficeId")));
 }
Exemple #11
0
 public static string GetNickname()
 {
     return(Conversion.TryCastString(SessionHelper.GetSessionKey("NickName")));
 }
Exemple #12
0
 public static long GetLogOnId()
 {
     return(Conversion.TryCastLong(SessionHelper.GetSessionKey("LogOnId")));
 }
Exemple #13
0
 public static string GetFax()
 {
     return(Conversion.TryCastString(SessionHelper.GetSessionKey("Fax")));
 }
Exemple #14
0
 public static string GetEmail()
 {
     return(Conversion.TryCastString(SessionHelper.GetSessionKey("Email")));
 }
Exemple #15
0
 public static string GetCountry()
 {
     return(Conversion.TryCastString(SessionHelper.GetSessionKey("Country")));
 }
Exemple #16
0
 public static bool IsSystem()
 {
     return(Conversion.TryCastBoolean(SessionHelper.GetSessionKey("IsSystem")));
 }
Exemple #17
0
 public static string GetBaseCurrency()
 {
     return(Conversion.TryCastString(SessionHelper.GetSessionKey("CurrencyCode")));
 }
Exemple #18
0
 public static DateTime GetSignInTimestamp()
 {
     return(Conversion.TryCastDate(SessionHelper.GetSessionKey("SignInTimestamp")));
 }