public clsMsg upload_bhavdata_row(clsCmd cmd)
        {
            int iDaily_PriceID = 0;

            string sDate1 = "";


            string sSymbol = "";
            string sSeries = "";


            sSymbol = cmd.getStringValue("symbol").Trim();
            sSeries = cmd.getStringValue("series").Trim();

            //DataRow[] rowsStock = getStockMaster().Select(string.Format(" symbol ='{0}' and series = '{1}' ", sSymbol, sSeries));

            NTier.CRUD.clsCRUD oCRUD_DailyPrice = _tier.getCRUD("tmp_bhavdata");


            //  iStockID = g.parseInt(rowsStock[0]["id"]);
            sDate1 = cmd.getStringValue("date1").Trim();
            //    iDaily_PriceID = oBLLStock.getDaily_PriceID(iStockID, sDate1);

            //cmd.setValue("mStockID", iStockID);
            cmd.setValue("id", 0);

            clsMsg msg = oCRUD_DailyPrice.save(cmd);

            return(msg);
        }
Ejemplo n.º 2
0
        public override clsAPIResponse call(clsCmd cmd)
        {
            var oCRUD   = new NTier.CRUD.clsCRUD(_appService.getAdapter(), Table, Table, idField, isIdentity);
            var oResult = oCRUD.save(cmd);

            return(new clsAPIResponse()
            {
                message = oResult.Message
            });
        }
Ejemplo n.º 3
0
        public clsAPIResponse save(clsCmd cmd)
        {
            var oCRUD   = new NTier.CRUD.clsCRUD(_appService.getAdapter(), name, name, autoIncrementField, true);
            var oResult = oCRUD.save(cmd);

            return(new clsAPIResponse()
            {
                message = oResult.Message, result = oResult.Obj
            });
        }
Ejemplo n.º 4
0
        public clsMsg upload_bhavdata_row(clsCmd cmd)
        {
            int    iDaily_PriceID = 0;
            int    iStockID       = 0;
            string sDate1         = "";


            string sSymbol = "";
            string sSeries = "";


            sSymbol = cmd.getStringValue("symbol").Trim();
            sSeries = cmd.getStringValue("series").Trim();

            DataRow[] rowsStock = getStockMaster().Select(string.Format(" symbol ='{0}' and series = '{1}' ", sSymbol, sSeries));

            NTier.CRUD.clsCRUD oCRUD_DailyPrice = _tier.getCRUD("trDaily_Price");

            if (rowsStock.Length > 0)
            {
                iStockID       = g.parseInt(rowsStock[0]["id"]);
                sDate1         = cmd.getStringValue("date1").Trim();
                iDaily_PriceID = oBLLStock.getDaily_PriceID(iStockID, sDate1);

                cmd.setValue("mStockID", iStockID);
                cmd.setValue("id", iDaily_PriceID);

                clsMsg msg = oCRUD_DailyPrice.save(cmd);

                return(msg);
            }
            else
            {
                if (sSeries.ToUpper().Trim() == "EQ")
                {
                    string sMsg = string.Format("Stock Master not found for Series : {0} And Symbol : {1}", sSeries, sSymbol);
                    return(g.msg(sMsg));
                }
            }

            return(g.msg(""));
        }
Ejemplo n.º 5
0
        public clsMsg upload_bhavdata_old(clsCmd cmd)
        {
            if (cmd.Files.Count == 0)
            {
                return(g.msg("Please select csv file"));
            }


            ///////////////////////////////////////////////////////
            var    oFile = cmd.Files[0];
            string sTmp  = System.IO.Path.GetTempFileName();

            System.IO.File.WriteAllBytes(sTmp, oFile.Data);
            ///////////////////////////////////////////////////////

            DataTable tStockMaster = oBLLStock.getStockMaster();

            NTier.CRUD.clsCRUD oCRUD_DailyPrice = _tier.getCRUD("trDaily_Price");

            DataTable t = g.readCSV(sTmp);

            foreach (DataColumn col in t.Columns)
            {
                col.ColumnName = col.ColumnName.Trim();
            }



            foreach (DataRow r in t.Rows)
            {
                var cmd2 = new clsCmd();
                cmd2.AddValues(r);

                int    iDaily_PriceID = 0;
                int    iStockID       = 0;
                string sDate1         = "";

                DataRow[] rowsStock = tStockMaster.Select(string.Format(" symbol ='{0}' and series = '{1}' ", r["symbol"].ToString().Trim(), r["series"].ToString().Trim()));

                if (rowsStock.Length > 0)
                {
                    iStockID       = g.parseInt(rowsStock[0]["id"]);
                    sDate1         = r["date1"].ToString().Trim();
                    iDaily_PriceID = oBLLStock.getDaily_PriceID(iStockID, sDate1);

                    cmd2.setValue("mStockID", iStockID);
                    cmd2.setValue("id", iDaily_PriceID);

                    var msg = oCRUD_DailyPrice.save(cmd2);

                    if (msg.Validated == false)
                    {
                        Console.WriteLine("");
                    }
                }
            }

            System.IO.File.Delete(sTmp);

            return(g.msg());
        }