Пример #1
0
        public static CustomList <Acc_COA> GetAllAcc_COA_ByLevelAll(int isSubsidiary, int voucherType)
        {
            ConnectionManager    conManager        = new ConnectionManager(ConnectionName.HR);
            CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>();
            IDataReader          reader            = null;
            String sql = string.Format("Select * From Acc_COA Where IsActive = 1  AND IsSubsidiary = {0} AND (ParentKey=9 OR ParentKey={1}) Order by COAName ASC", isSubsidiary, voucherType);

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA.SetData(reader);
                    Acc_COACollection.Add(newAcc_COA);
                }
                Acc_COACollection.InsertSpName = "spInsertAcc_COA";
                Acc_COACollection.UpdateSpName = "spUpdateAcc_COA";
                Acc_COACollection.DeleteSpName = "spDeleteAcc_COA";
                return(Acc_COACollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #2
0
        public static CustomList <Acc_COA> GetAllAcc_COAGetReceivable()
        {
            ConnectionManager    conManager        = new ConnectionManager(ConnectionName.HR);
            CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>();
            IDataReader          reader            = null;
            String sql = "Select COAKey,COAName From Acc_COA Where COAName='Inventory  A/C'";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA.COAKey  = reader.GetInt64("COAKey");//.SetData(reader);
                    newAcc_COA.COAName = reader.GetString("COAName");
                    Acc_COACollection.Add(newAcc_COA);
                }
                return(Acc_COACollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #3
0
        public static CustomList <Acc_COA> GetAllAcc_COA_ByLevel(int isSubsidiary)
        {
            ConnectionManager    conManager        = new ConnectionManager(ConnectionName.HR);
            CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>();
            IDataReader          reader            = null;
            String sql = string.Format("EXEC spGetAllAccountHead");

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA._COAKey  = reader.GetInt64("COAKey");
                    newAcc_COA._COAName = reader.GetString("COAName");

                    Acc_COACollection.Add(newAcc_COA);
                }
                Acc_COACollection.InsertSpName = "spInsertAcc_COA";
                Acc_COACollection.UpdateSpName = "spUpdateAcc_COA";
                Acc_COACollection.DeleteSpName = "spDeleteAcc_COA";
                return(Acc_COACollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #4
0
        public static CustomList <Acc_COA> GetAllAcc_COA_CashAtBank()
        {
            ConnectionManager    conManager        = new ConnectionManager(ConnectionName.HR);
            CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>();
            IDataReader          reader            = null;
            String sql = string.Format("EXEC spGetAllBankDepositAccount");

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA._COAKey  = reader.GetInt64("COAKey");
                    newAcc_COA._COAName = reader.GetString("COAName");

                    Acc_COACollection.Add(newAcc_COA);
                }
                return(Acc_COACollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #5
0
        public static CustomList <Acc_COA> GetAllAcc_COA_ByLevel(int level)
        {
            ConnectionManager    conManager        = new ConnectionManager(ConnectionName.HR);
            CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>();
            IDataReader          reader            = null;
            String sql = string.Format("Select * From Acc_COA Where IsActive = 1 And IsPostingHead = 1 Order by COAName ASC");

            // String sql = string.Format("Select * From Acc_COA Where IsActive = 1 And COALevel = {0} Order by COAName ASC", level);
            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA.SetData(reader);
                    Acc_COACollection.Add(newAcc_COA);
                }
                return(Acc_COACollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #6
0
        public static CustomList <Acc_COA> GetAllAcc_COA()
        {
            ConnectionManager    conManager        = new ConnectionManager(ConnectionName.HR);
            CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>();
            IDataReader          reader            = null;
            String sql = "Select * From Acc_COA Where IsPostingHead = 1";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA.SetData(reader);
                    Acc_COACollection.Add(newAcc_COA);
                }
                return(Acc_COACollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #7
0
        public static CustomList <Acc_COA> GetAllAcc_COA(bool isAll = false)
        {
            ConnectionManager    conManager        = new ConnectionManager(ConnectionName.HR);
            CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>();
            IDataReader          reader            = null;
            String sql = string.Empty;

            if (isAll == true)
            {
                sql = "Select * From Acc_COA Where IsActive = 1 Order by COAName ASC";
            }
            else
            {
                sql = "Select * From Acc_COA Where IsActive = 1 And IsSubsidiary=1 Order by COAName ASC";
            }
            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA.SetData(reader);
                    Acc_COACollection.Add(newAcc_COA);
                }
                Acc_COACollection.InsertSpName = "spInsertAcc_COA";
                Acc_COACollection.UpdateSpName = "spUpdateAcc_COA";
                Acc_COACollection.DeleteSpName = "spDeleteAcc_COA";
                return(Acc_COACollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #8
0
        public static CustomList <Acc_COA> GetAllCashOrBankCOA(String menuName)
        {
            ConnectionManager    conManager        = new ConnectionManager(ConnectionName.HR);
            CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>();
            IDataReader          reader            = null;
            String sql = "";

            if (menuName == "CashPaymantVoucher" || menuName == "CashReceiveVoucher")
            {
                sql = "Select * From Acc_COA Where IsCash = 1";
            }
            if (menuName == "BankPaymentVoucher" || menuName == "BankReceiveVoucher")
            {
                sql = "Select COA.* From Acc_COA COA INNER JOIN CmnBankAccount BA ON BA.COAID=COA.COAKey Where BA.IsCompany=1";
            }
            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA.SetData(reader);
                    Acc_COACollection.Add(newAcc_COA);
                }
                return(Acc_COACollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #9
0
 public static CustomList<Acc_COA> GetAllCashOrBankCOA(String menuName)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<Acc_COA> Acc_COACollection = new CustomList<Acc_COA>();
     IDataReader reader = null;
     String sql = "";
     if (menuName == "CashPaymantVoucher" || menuName == "CashReceiveVoucher")
         sql = "Select * From Acc_COA Where IsCash = 1";
     if (menuName == "BankPaymentVoucher" || menuName == "BankReceiveVoucher")
         sql = "Select COA.* From Acc_COA COA INNER JOIN CmnBankAccount BA ON BA.COAID=COA.COAKey Where BA.IsCompany=1";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             Acc_COA newAcc_COA = new Acc_COA();
             newAcc_COA.SetData(reader);
             Acc_COACollection.Add(newAcc_COA);
         }
         return Acc_COACollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Пример #10
0
 public static CustomList<Acc_COA> GetAllAcc_COA_ByLevel(int level)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<Acc_COA> Acc_COACollection = new CustomList<Acc_COA>();
     IDataReader reader = null;
     String sql = string.Format("Select * From Acc_COA Where IsActive = 1 And IsPostingHead = 1 Order by COAName ASC");
        // String sql = string.Format("Select * From Acc_COA Where IsActive = 1 And COALevel = {0} Order by COAName ASC", level);
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             Acc_COA newAcc_COA = new Acc_COA();
             newAcc_COA.SetData(reader);
             Acc_COACollection.Add(newAcc_COA);
         }
         return Acc_COACollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Пример #11
0
        public static CustomList<Acc_COA> GetAllAcc_COA(bool isAll = false)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList<Acc_COA> Acc_COACollection = new CustomList<Acc_COA>();
            IDataReader reader = null;
            String sql = string.Empty;

            if (isAll == true)
                sql = "Select * From Acc_COA Where IsActive = 1 Order by COAName ASC";
            else
                sql = "Select * From Acc_COA Where IsActive = 1 And COALevel=5 Order by COAName ASC";
            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA.SetData(reader);
                    Acc_COACollection.Add(newAcc_COA);
                }
                return Acc_COACollection;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
Пример #12
0
        public static CustomList<Acc_COA> GetAllAcc_COA()
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList<Acc_COA> Acc_COACollection = new CustomList<Acc_COA>();
            IDataReader reader = null;
            String sql = "Select * From Acc_COA Where IsPostingHead = 1";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_COA newAcc_COA = new Acc_COA();
                    newAcc_COA.SetData(reader);
                    Acc_COACollection.Add(newAcc_COA);
                }
                return Acc_COACollection;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
Пример #13
0
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtCHead.Text.IsNullOrEmpty())
                {
                    ((API.UI.ACC.COA)this.Page).ErrorMessage = "Please provide Head Name.";
                    return;
                }

                Acc_COA dupitem = _COA.Find(p => p.COAName == txtCHead.Text.Trim() && p.ParentKey == _SelectedCOAKey);
                if (dupitem != null)
                {
                    ((API.UI.ACC.COA)this.Page).ErrorMessage = "Duplicate Head Name could not be created.";
                    return;
                }

                Acc_COA selectedItem = _COA.Find(p => p.COAKey == _SelectedCOAKey);
                if (selectedItem != null)
                {
                    Acc_COA newItem = new Acc_COA();

                    newItem.COALevel = selectedItem.COALevel + 1;
                    newItem.COAName = txtCHead.Text.Trim();
                    newItem.IsActive = chkActive.Checked;
                    newItem.ParentKey = _SelectedCOAKey;
                    newItem.COAKey = _COA.Count + Int32.MinValue;

                    if (ddlFromCostCentre.SelectedValue.ToString() == "")
                    {
                        newItem.CostCenterID = null;
                    }
                    else
                    {
                        newItem.CostCenterID = ddlFromCostCentre.SelectedValue.ToInt();
                    }

                    newItem.IsDefaultCash = chkIsDefaultCash.Checked;
                    newItem.IsCash = chkIsCash.Checked;

                    newItem.IsPostingHead = chkPostingHea.Checked;

                    //((ST.Web.Hr.Initialization.Setup.COA)this.Page).CurrentUserSession.UserCode;

                    _COA.Add(newItem);

                    if (SaveCOA())
                        ((API.UI.ACC.COA)this.Page).SuccessMessage = StaticInfo.SavedSuccessfullyMsg;
                }
            }
            catch (Exception ex)
            {
                ((API.UI.ACC.COA)this.Page).ErrorMessage = ex.Message;
            }
        }