/// <summary>
        ///
        /// </summary>
        /// <param name="AccountGroupId"></param>
        /// <returns></returns>
        public AccountGroupInfo AccountGroupView(decimal AccountGroupId)
        {
            AccountGroupInfo infoAccountGroup = new AccountGroupInfo();

            try
            {
                infoAccountGroup = spAccountGroup.AccountGroupView(AccountGroupId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("AG10:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(infoAccountGroup);
        }
Esempio n. 2
0
        private void cmbGroupUnder_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (cmbGroupUnder.SelectedValue != null && cmbGroupUnder.SelectedValue.ToString() != "System.Data.DataRowView")
                {
                    decimal          decAccountGroupId = Convert.ToDecimal(cmbGroupUnder.SelectedValue.ToString());
                    AccountGroupSP   spAccountGroup    = new AccountGroupSP();
                    AccountGroupInfo infoAccountGroup  = new AccountGroupInfo();
                    infoAccountGroup = spAccountGroup.AccountGroupView(decAccountGroupId);
                    string strNature = infoAccountGroup.Nature;
                    string strIsAffectGrossProfit = infoAccountGroup.AffectGrossProfit;
                    // string strNature = spAccountGroup.AccountGroupNatureUnderGroup(decAccountGroupId);
                    if (strNature != "NA")
                    {
                        cmbNature.Text = strNature;
                        if (infoAccountGroup.AffectGrossProfit == "1")
                        {
                            cmbAffectGrossProfit.SelectedIndex = 0;
                        }
                        else
                        {
                            cmbAffectGrossProfit.SelectedIndex = 1;
                        }
                        cmbNature.Enabled            = false;
                        cmbAffectGrossProfit.Enabled = false;
                    }
                    else
                    {
                        cmbNature.Enabled            = true;
                        cmbAffectGrossProfit.Enabled = true;
                    }
                }
            }
            catch (Exception)
            {
            }
            //if (txtAccountGroupName.Text != null && txtAccountGroupName.Text != string.Empty)
            //{


            //}
            //else
            //{
            //    cmbNature.Enabled = true;
            //}
        }