示例#1
0
    protected void Last8DaysPurchase()
    {
        DataTable dt = new DataTable();

        dt = CommonClasses.Execute("select ROW_NUMBER() OVER (ORDER BY IWM_CHAL_DATE) AS RowNum,IWM_CHAL_DATE,FORMAT(ROUND(SUM(IWD_CH_QTY*ROUND(IWD_RATE,2)),2),'C', 'en-IN') AS GrandAmt from INWARD_MASTER,INWARD_DETAIL where IWM_CODE=IWD_IWM_CODE and INWARD_MASTER.ES_DELETE=0 and IWM_CHAL_DATE between DATEADD(DAY, -10, getdate())  and GETDATE() group by IWM_CHAL_DATE");
        DataSet ds = new DataSet();

        ds.Tables.Add(dt);
        Repeaterpurchase.DataSource = ds;
        Repeaterpurchase.DataBind();
    }
示例#2
0
    protected void Last8DaysPurchase()
    {
        DataTable dt = new DataTable();

        dt = CommonClasses.Execute("declare @sumvalue table (RowNum int identity(1,1),INM_DATE varchar(500),GrandAmt nvarchar(1000),Total nvarchar(1000),GrandAmtwithoutformat float) insert into @sumvalue select CONVERT(varchar, Cast(IWM_CHAL_DATE as date), 103) as IWM_CHAL_DATE,FORMAT(ROUND(SUM(IWD_CH_QTY*ROUND(IWD_RATE,2)),2),'C', 'en-IN') AS GrandAmt,0,ROUND(SUM(IWD_CH_QTY*ROUND(IWD_RATE,2)),2) from INWARD_MASTER,INWARD_DETAIL where IWM_CODE=IWD_IWM_CODE and INWARD_MASTER.ES_DELETE=0 and IWM_CHAL_DATE between DATEADD(DAY, -9, getdate())  and GETDATE() group by IWM_CHAL_DATE order by IWM_CHAL_DATE desc declare @Totalvalue float select @Totalvalue=sum(GrandAmtwithoutformat) from @sumvalue update @sumvalue set total= FORMAT(@Totalvalue,'C', 'en-IN') select * from @sumvalue");
        DataSet ds = new DataSet();

        ds.Tables.Add(dt);
        if (dt.Rows.Count > 0)
        {
            lbltotal8daysPurchase.Text = dt.Rows[0]["Total"].ToString();
        }
        Repeaterpurchase.DataSource = ds;
        Repeaterpurchase.DataBind();
    }