Esempio n. 1
0
        public Double GetPartyBalance(int partyid)
        {
            DataTable dt = DBClass.GetData("select sum(cramount)-sum(dbamount) as balance from party_ledger where partyid=" + partyid.ToString());

            return(Convert.ToDouble(dt.Rows[0]["balance"]));
        }
Esempio n. 2
0
        public String GetNewVoucherNo(int vtype, DateTime finstart, DateTime finend, int divid, String divname)
        {
            int    vno    = 0;
            String prefix = "";
            String fld    = "";
            String Fstart = Getyear(finstart);
            String Fend   = Getyear(finend);

            switch (vtype)
            {
            case 1:
            {
                fld = "Cadtvoc"; prefix = "Cadtvoc/" + Fstart + "-" + Fend + "/"; break;
            }

            case 2:
            {
                fld = "Padtvoc"; prefix = "Padtvoc/" + Fstart + "-" + Fend + "/"; break;
            }

            case 3:
            {
                fld = "Sadtvoc"; prefix = "Sadtvoc/" + Fstart + "-" + Fend + "/"; break;
            }

            case 4:
            {
                fld = "Radtvoc"; prefix = "Radtvoc/" + Fstart + "-" + Fend + "/"; break;
            }

            case 5:
            {
                fld = "Adjvoc"; prefix = "Adjvoc/" + Fstart + "-" + Fend + "/"; break;
            }

            case 6:
            {
                fld = "Cadtbpo"; prefix = "Cadtbpo/" + Fstart + "-" + Fend + "/"; break;
            }

            case 7:
            {
                fld = "Padtbpo"; prefix = "Padtbpo/" + Fstart + "-" + Fend + "/"; break;
            }

            case 8:
            {
                fld = "Radtbpo"; prefix = "Radtbpo/" + Fstart + "-" + Fend + "/"; break;
            }

            case 9:
            {
                fld = "Sadtbpo"; prefix = "Sadtbpo/" + Fstart + "-" + Fend + "/"; break;
            }

            case 10:
            {
                fld = "cash"; prefix = "cash/" + Fstart + "-" + Fend + "/"; break;
            }
            }
            String Sql = "select " + fld + " from autoidgen where divid=" + divid;

            vno = Convert.ToInt32(DBClass.GetData(Sql).Rows[0][fld]) + 1;
            return(prefix + divname.Substring(0, 3) + "/" + FixedInt(vno));
        }