Ejemplo n.º 1
0
 private void OrgAccountAccess_Load(object sender, System.EventArgs e)
 {
     try
     {
         this.sqldaUsers.Fill(this.dsUsers1);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "BPS", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     for (int counter = 0; counter < dsUsers1.Users.Rows.Count; counter++)
     {
         BPS.BLL.Orgs.DataSets.dsUsers.UsersRow row = (BPS.BLL.Orgs.DataSets.dsUsers.UsersRow)dsUsers1.Users.Rows[counter];
         clbUsers.Items.Add(row.UserName);
         if (row.IsAdmin)
         {
             this.clbUsers.SetItemChecked(counter, true);
         }
         else
         {
             this.clbUsers.SetItemChecked(counter, false);
         }
     }
     this.dsOrgs1.Clear();
     this.dsOrgs1 = (BPS.BLL.Orgs.DataSets.dsOrgs)App.DsOrgs.Copy();
     dvOrgs.Table = this.dsOrgs1.Orgs;
     this.cmbOrgName.DataSource    = dvOrgs;
     this.cmbOrgName.DisplayMember = "OrgName";
     this.cmbOrgName.ValueMember   = "OrgID";
     FillOrgsAccountAccess();
     this.dvOrgsAccount.Table = this.dsOrgsAccountAccess1.OrgAccountsAccess;
     App.SetDataGridTableStyle(this.dgOrgsAccounts.TableStyles[0]);
     BPS.BLL.Orgs.DataSets.dsOrgs.OrgsRow rw = this.dsOrgs1.Orgs.NewOrgsRow();
     rw.OrgID                = 0;
     rw.OrgName              = "<Все>";
     rw.OrgName2             = "<Все>";
     rw.IsNormal             = true;
     rw.IsInner              = true;
     rw.IsSpecial            = true;
     rw.DefaultServiceCharge = 0;
     rw.CodeINN              = "";
     rw.CodeKPP              = "";
     this.dsOrgs1.Orgs.Rows.Add(rw);
     this.dvOrgs.Sort            = "OrgName,IsNormal DESC";
     this.dvOrgs.RowFilter       = "IsInner=true AND IsRemoved=false";
     this.clbUsers.SelectedIndex = 0;
     CurrentUserID = (int)this.dsUsers1.Users.Rows[this.clbUsers.SelectedIndex]["UserID"];
 }
Ejemplo n.º 2
0
        public PaymentsOrdersEdit(BPS.BLL.PaymentOrders.DataSets.dsPaymentOrderList.PaymentsOrdersListRow rw, bool bIsSend)
        {
            this.rw      = rw;
            this.bIsSend = bIsSend;
            App.FillOrgsAccount();
            InitializeComponent();
            this.tbNo.Text             = rw.PaymentNo;
            this.dateTimePicker1.Value = rw.PaymentOrderDate;
            this.tbSum.dValue          = rw.PaymentOrderSum;
            this.tbCurr.Text           = rw.CurrencyID;
            this.tbOrg.Text            = rw.OrgNameCorr;
            this.tbOrgPO.Text          = rw.POOrgNameCorr;
            BPS.BLL.Orgs.DataSets.dsOrgs         ds  = (BPS.BLL.Orgs.DataSets.dsOrgs)App.DsOrgs.Copy();
            BPS.BLL.Orgs.DataSets.dsOrgs.OrgsRow row = ds.Orgs.FindByOrgID(rw.OrgIDCorr);
            this.tbCodeKPP.Text = "";
            if (row != null && !row.IsCodeKPPNull())
            {
                this.tbCodeKPP.Text = row.CodeKPP.ToString();
            }
            this.tbRaccount.Text = rw.RAccountCorr;
            this.tbBankName.Text = rw.BankNameCorr;
            if (!rw.IsCityNameCorrNull())
            {
                this.tbBankName.Text += ", г. " + rw.CityNameCorr;
            }

            this.tbBIK.Text      = rw.CodeBIKCorr;
            this.tbKAccount.Text = rw.KAccountCorr;
            this.tbINN.Text      = rw.CodeINNCorr;
            if (!rw.IsPaymentOrderPurposeNull())
            {
                this.tbPurpose.Text = rw.PaymentOrderPurpose;
            }
            if (!rw.IsRemarksNull())
            {
                this.tbRemarks.Text = rw.Remarks;
            }
            if (bIsSend)
            {
                this.tbNo.ReadOnly           = true;
                this.dateTimePicker1.Enabled = false;
                this.tbPurpose.ReadOnly      = true;
            }
            //		this.drawBankString(rw.OrgAccountIDCorr);
        }