Esempio n. 1
0
        public Ledgers.DAILYCLOSINGDataTable GetSPCP(DateTime d1,int spcp,bool useconstr,string newconstr)
        {

            var ta = new LedgersTableAdapters.DAILYCLOSINGTableAdapter { Connection = { ConnectionString = useconstr ? newconstr : _constr } };
            var ds = new Ledgers().DAILYCLOSING;

            if (spcp == 1)
                ta.FillBySPCP(ds, d1, 2);
            else if (spcp == 2)
                ta.FillBySPCP(ds, d1, 3);

            return ds;
        }
Esempio n. 2
0
 public Ledgers.DAILYCLOSINGDataTable GetDailyClosing()
 {
     var ta = new LedgersTableAdapters.DAILYCLOSINGTableAdapter {Connection = {ConnectionString = _constr}};
     var ds = new Ledgers().DAILYCLOSING;
     ta.FillByCompany(ds, Utils.Company);
     return ds;
 }
Esempio n. 3
0
 public Ledgers.DAILYCLOSINGDataTable GetLastClosing(DateTime d1, bool isdate)
 {
     var ta = new LedgersTableAdapters.DAILYCLOSINGTableAdapter {Connection = {ConnectionString = _constr}};
     var ds = new Ledgers().DAILYCLOSING;
     if (isdate)
         ta.FillByMaxdateToDate(ds, Utils.Company,d1);
     else
         ta.FillByMaxdate(ds, Utils.Company);
     
     return ds;
 }
Esempio n. 4
0
        public int DoSave(int ctype, string ctext, decimal cvalue, DateTime dt,bool isbeg)
        {
            var ta = new LedgersTableAdapters.DAILYCLOSINGTableAdapter {Connection = {ConnectionString = _constr}};

            var cn = new SqlConnection(_constr);
            var cmd = new SqlCommand();
            cn.Open();
            //"yyyy-MM-dd HH:mm:ss"
            var fg = isbeg ? 1 : 0;
            cmd.Connection = cn;
            string scmd = "  INSERT INTO DAILYCLOSING (CTYPE, CNAME, CVALUE, CDATE, USERID, COMPANY, ISBEG) ";
            scmd += " VALUES (" + ctype + ",'" + ctext + "'," + cvalue + ",'" + dt.ToString("yyyy-MM-dd HH:mm:ss") + "', " + Utils.Userid + ",'" + Utils.Company + "'," + fg + ") ";
            cmd.CommandText = scmd;
            return cmd.ExecuteNonQuery();
            //return ta.Insert(ctype, ctext, cvalue, dt, Utils.Userid, Utils.Company,isbeg);
        }