private void spinEdit1_EditValueChanged(object sender, EventArgs e)
        {
            Account sg = new Account();
            sg.LoadByPrimaryKey(rs.StoreID);
            if (Convert.ToDouble(txtMargin.EditValue) > 0 && sg.ModeID == Mode.Constants.HEALTH_PROGRAM)
            {
                txtMargin.EditValue = 0;
            }
            if (Convert.ToDouble(txtSellingPrice.EditValue) != (Convert.ToDouble(txtAverageCost.EditValue) * (1 + Convert.ToDouble(txtMargin.EditValue))))
            {
                txtSellingPrice.EditValue = Convert.ToDouble(txtAverageCost.EditValue) * (1 + Convert.ToDouble(txtMargin.EditValue));

            }
        }
コード例 #2
0
        public static GridLookUpEditBase SetupAccountEditor(this GridLookUpEditBase editor)
        {
            editor.Properties.DisplayMember = "AccountName";
            editor.Properties.NullText = "Select Account";
            editor.Properties.ValueMember = "AccountID";
            editor.EditValue = null;
            editor.Properties.View = InitializeAccountGridView();

            var accounts = new Account();
            accounts.LoadByUser(CurrentContext.UserId);
            editor.Properties.DataSource = accounts.DefaultView;
            return editor;
        }
        private void gridItemsView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            DataRow dr = gridItemsView.GetFocusedDataRow();

            lblIssueType.Text = dr["OrderType"]!=DBNull.Value ? (string) dr["OrderType"] : "-";

            if ((dr["ReceivingUnitID"]) != DBNull.Value)
            {
                var ins = new Institution();
                ins.LoadByPrimaryKey(Convert.ToInt32(dr["ReceivingUnitID"]));

                lblRegion.Text = ins.RegionName ?? "-";
                lblWoreda.Text = ins.WoredaName ?? "-";
                lblZone.Text = ins.ZoneName ?? "-";

                var own = new OwnershipType();
                own.LoadByPrimaryKey(ins.Ownership);
                lblOwnership.Text = own.Name ?? "-";

                var iss = new Issue();
                iss.LoadByPrimaryKey(Convert.ToInt32(dr["STVID"]));

                if (!iss.IsColumnNull("PaymentTypeID"))
                {
                    var pType = new PaymentType();

                     pType.LoadByPrimaryKey(iss.PaymentTypeID);
                    lblPaymentType.Text = pType.Name;

                }
                lblPaymentType.Text = "-";

                if (!iss.IsColumnNull("VoidRequestDateTime"))
                    lblVoidRequestedDate.Text = iss.VoidRequestDateTime.ToShortDateString();
                else
                {
                    lblVoidRequestedDate.Text = "-";
                }
               if(!iss.IsColumnNull("VoidApprovalDateTime"))
                lblVoidConfirmedDate.Text= iss.VoidApprovalDateTime.ToShortDateString();
               else
               {
                   lblVoidConfirmedDate.Text = "-";

               }
               var user = new User();
                if (!iss.IsColumnNull("VoidRequestUserID"))
                {

                    user.LoadByPrimaryKey(iss.VoidRequestUserID);
                    lblVoidRequestedBy.Text = user.FullName;
                }
                else lblVoidRequestedBy.Text = "-";
                if (!iss.IsColumnNull("VoidApprovedByUserID"))
                {
                    user.LoadByPrimaryKey(iss.VoidApprovedByUserID);
                    lblVoidConfirmedBy.Text = user.FullName;
                }
                else lblVoidConfirmedBy.Text = "-";

                lblInstitutionType.Text = ins.InstitutionTypeName;

                if (!iss.IsColumnNull("DocumentTypeID"))
                {
                    lblDocumentType.Text = DocumentType.GetDocumentType(iss.DocumentTypeID).Name;
                }
                else
                    lblDocumentType.Text = "";

            }
            else
            {
                lblRegion.Text = lblWoreda.Text = lblZone.Text = "-";
            }

            lblPrintedDate.Text = string.IsNullOrEmpty((Convert.ToDateTime(dr["PrintedDate"].ToString())).ToShortDateString()) ? "-" : (Convert.ToDateTime(dr["PrintedDate"].ToString())).ToShortDateString();
            lblAccount.Text = string.IsNullOrEmpty(dr["AccountName"].ToString()) ? "-" : dr["AccountName"].ToString();
            lblSubAccount.Text = string.IsNullOrEmpty(dr["SubAccountName"].ToString()) ? "-" : dr["SubAccountName"].ToString();
            lblActivity.Text = string.IsNullOrEmpty(dr["ActivityName"].ToString()) ? "-" : dr["ActivityName"].ToString();
            lblPrintedBy.Text = string.IsNullOrEmpty(dr["IssuedBy"].ToString()) ? "-" : dr["IssuedBy"].ToString();

            lblIssueStatus.Text = string.IsNullOrEmpty(dr["Status"].ToString()) ? "-" : dr["Status"].ToString();
               int accountid =  Convert.ToInt32(dr["AccountID"]);
               Account account = new Account();
               account.LoadByPrimaryKey(accountid);
               Mode mode = new Mode();
               mode.LoadByPrimaryKey(account.ModeID);
               lblMode.Text = mode.TypeName;
        }
コード例 #4
0
        private void LoadMaster()
        {
            //Populate Item Name
            Item item = new Item();
            item.LoadByPrimaryKey(ItemID);
            txtitem.Text = item.FullItemName;

            //Populate Manufacturer
            Manufacturer mf = new Manufacturer();
            mf.LoadByPrimaryKey(ManufacturerID);
            txtManufacturer.Text = mf.Name;

            //Populate Unit
            ItemUnit unit = new ItemUnit();
            unit.LoadByPrimaryKey(UnitID);
            txtUnit.Text = unit.Text;

            //Populate Account
            Account Account = new Account();
            Account.LoadByPrimaryKey(StoreID);
            txtAccount.Text = Account.Name;
            if(BLL.Settings.IsCenter)
            layoutSellingPrice.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
        }
        private void lkAccount_EditValueChanged(object sender, EventArgs e)
        {
            if (lkAccount.EditValue != null && layoutMonth.Visibility == LayoutVisibility.Never && layoutYear.Visibility == LayoutVisibility.Always)
            {
                cbYear_SelectedIndexChanged(null, null);
            }
            else if(lkAccount.EditValue != null && layoutMonth.Visibility != LayoutVisibility.Always)
            {

                var accountID = Convert.ToInt32(lkAccount.EditValue);
                var account = new StockStatusByAccount(CurrentContext.LoggedInUserName);
                var account2 =  new StockStatusByAccountWithUnitPrice(CurrentContext.LoggedInUserName);
                if (chkExludeDamaged.Checked)
                {
                    if (Convert.ToBoolean(checkShowUnitPrice.Checked))
                    {
                        account2.DataSource = Balance.GetStockStatusByAccountDamagedExcluded(accountID, Convert.ToBoolean(checkShowUnitPrice.Checked));
                        printControl1.PrintingSystem = account2.PrintingSystem;
                    }

                    else
                    {
                        account.DataSource = Balance.GetStockStatusByAccountDamagedExcluded(accountID, Convert.ToBoolean(checkShowUnitPrice.Checked));
                        printControl1.PrintingSystem = account.PrintingSystem;
                    }

                }
                else
                {
                    if (Convert.ToBoolean(checkShowUnitPrice.Checked))
                    {
                        account2.DataSource = Balance.GetStockStatusByAccount(accountID, Convert.ToBoolean(checkShowUnitPrice.Checked));
                        printControl1.PrintingSystem = account2.PrintingSystem;
                    }

                    else
                    {
                        account.DataSource = Balance.GetStockStatusByAccount(accountID, Convert.ToBoolean(checkShowUnitPrice.Checked));
                        printControl1.PrintingSystem = account.PrintingSystem;
                    }
                }

                var accountO = new Account();
                accountO.LoadByPrimaryKey(accountID);

                if (Convert.ToBoolean(checkShowUnitPrice.Checked))
                {
                    account2.AccountName.Text = accountO.Name;
                    report = account2;
                    account2.CreateDocument();
                }
                else
                {

                    account.AccountName.Text = accountO.Name;
                    report = account;
                    account.CreateDocument();
                }

            }

            else if (lkAccount.EditValue != null && cbMonth.SelectedItem != null && cbYear.SelectedItem != null && cbToYear.SelectedItem != null && cbToMonth.SelectedItem != null && listBoxControl1.SelectedItem.ToString().Equals("Vital Report"))
            {
                LadVitalItemReport();
            }

            else
            {
                cbMonth_SelectedIndexChanged(null,null);
            }
        }