public void ReportGrid(string RepCondition)
    {
        try
        {
            DS = Obj_SL.GetStockLocation(RepCondition, out StrError);

            if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
            {
                GrdReport.DataSource = DS.Tables[0];
                GrdReport.DataBind();
            }
            else
            {
                GrdReport.DataSource = null;
                GrdReport.DataBind();
            }
            if (DS.Tables.Count > 0 && DS.Tables[1].Rows.Count > 0)
            {
                ddlcompany.DataSource     = DS.Tables[1];
                ddlcompany.DataValueField = "CompanyId";
                ddlcompany.DataTextField  = "CompanyName";
                ddlcompany.DataBind();
            }
            Obj_SL = null;
            DS     = null;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
    protected void BtnShow_Click(object sender, EventArgs e)
    {
        try
        {
            DateTime dt;
            if (DateTime.TryParse(txtFromDate.Text.ToString(), out dt) == false)
            {
                Obj_Comm.ShowPopUpMsg("Please enter valid as on date..", this.Page);
                txtFromDate.Focus();
                return;
            }

            if (DateTime.Parse(txtFromDate.Text.ToString()) > DateTime.Now.Date)
            {
                Obj_Comm.ShowPopUpMsg("As on date should be less than or equal to todays date.", this.Page);
                txtFromDate.Focus();
                return;
            }

            DataSet ds = Obj_PO.Get_PONotComplete(txtFromDate.Text.ToString(), out StrError);
            if (ds.Tables.Count > 0)
            {
                GrdReport.DataSource = ds.Tables[0];
                GrdReport.DataBind();
            }
        }
        catch (Exception exp)
        {
            throw new Exception(exp.Message);
        }
    }
 private void ReportGrid(string RepCondition)
 {
     try
     {
         if (Session["Admin"].Equals("ADMIN"))
         {
             RepCondition = string.Empty;
         }
         else
         {
             RepCondition = RepCondition + " and S.CreatedBy=" + Convert.ToInt32(Session["UserID"]) + "";
         }
         Ds = Obj_Call.GetList(RepCondition, out StrError);
         if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
         {
             HttpContext.Current.Cache["Dir"] = Ds.Tables[0];
             GrdReport.DataSource             = Ds.Tables[0];
             GrdReport.DataBind();
             // ViewState["CurrentTable"] = Ds.Tables[0];
         }
         else
         {
             GrdReport.DataSource = null;
             GrdReport.DataBind();
         }
         //Obj_Call = null;
         Ds = null;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
 protected void BtnExport_Click(object sender, EventArgs e)
 {
     try
     {
         if (ViewState["GridView"] != null)
         {
             DataTable dtFirstGrid = (DataTable)ViewState["GridView"];
             //========Call Register
             GridView GridExp = new GridView();
             dtFirstGrid.Columns.Remove("Closing");
             dtFirstGrid.Columns.Remove("#");
             dtFirstGrid.Columns.Remove("LedgerID");
             GridExp.DataSource = dtFirstGrid;
             GridExp.DataBind();
             obj_Comman.Export("Outstanding_Balance_Sheet.xls", GridExp);
         }
         else
         {
             obj_Comman.ShowPopUpMsg("No Data Found To Export..!", this.Page);
             GrdReport.DataSource = null;
             GrdReport.DataBind();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
    public void ReportGrid(string RepCondition)
    {
        try
        {
            Ds = Obj_CCMaster.GetItem(RepCondition, out StrError);
            if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
            {
                ViewState["CurrentTable1"] = Ds.Tables[0];
                if (Ds.Tables[0].Rows.Count > 16)
                {
                    rptPages.Visible = true;
                    //CallPagging();
                }
                else
                {
                    GrdReport.DataSource = Ds.Tables[0];
                    GrdReport.DataBind();
                    rptPages.Visible = false;
                }
            }
            else
            {
                GrdReport.DataSource = null;
                GrdReport.DataBind();
            }

            //TxtSearchCategory_TextChanged(TxtSearchSubCategory, System.EventArgs.Empty);
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }
Exemple #6
0
    public void FilterMinistry(string ministry = "----All Ministry----", string pprid = "")
    {
        string Query = string.Empty;


        //pprid= pprid!=""? " and PPRId  like  '%" + pprid + "%'":"" ;

        if (!string.IsNullOrEmpty(ministry))
        {
            DataTable dt       = (DataTable)ViewState["DataList"];
            DataView  dataView = dt.DefaultView;
            if (ministry != "-----Select Ministry-----" && pprid != "")
            {
                Query += "InitialMinistry  =  '" + ministry + "'";
                pprid  = pprid != "" ? " and PPRId  like  '%" + pprid + "%'" : "";
                dataView.RowFilter = Query + pprid;
            }
            else if (ministry != "-----Select Ministry-----")
            {
                dataView.RowFilter = "InitialMinistry  =  '" + ministry + "'";
            }
            else if (pprid != "")
            {
                pprid = pprid != "" ? "  PPRId  like  '%" + pprid + "%'" : "";
                dataView.RowFilter = pprid;
            }
            GrdReport.DataSource = dataView;
            GrdReport.DataBind();
        }
    }
    public void SetInitialRow()
    {
        try
        {
            DataTable dt = new DataTable();
            DataRow   dr = null;
            dt.Columns.Add(new DataColumn("#", typeof(int)));
            dt.Columns.Add(new DataColumn("Particulars", typeof(string)));
            dt.Columns.Add(new DataColumn("Debit", typeof(string)));
            dt.Columns.Add(new DataColumn("Credit", typeof(string)));
            dt.Columns.Add(new DataColumn("LedgerID", typeof(string)));

            dr = dt.NewRow();

            dr["#"]           = 0;
            dr["Particulars"] = "";
            dr["Debit"]       = "";
            dr["Credit"]      = "";
            dr["LedgerID"]    = "";

            dt.Rows.Add(dr);
            ViewState["CurrentTable"] = dt;
            GrdReport.DataSource      = dt;
            GrdReport.DataBind();
            dt = null;
            dr = null;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Exemple #8
0
    public void ReportGrid(string RepCondition)
    {
        try
        {
            DS = Obj_EM.GeteEmployee(RepCondition, out StrError);

            if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
            {
                GrdReport.DataSource = DS.Tables[0];
                GrdReport.DataBind();
            }
            else
            {
                GrdReport.DataSource = null;
                GrdReport.DataBind();
            }
            Obj_EM = null;
            DS     = null;
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Exemple #9
0
    private void SetInitialRow_IssueDetails()
    {
        DataTable dt = new DataTable();
        DataRow   dr;

        dt.Columns.Add("#", typeof(Int32));
        dt.Columns.Add("IssueNo", typeof(string));
        dt.Columns.Add("IssueDate", typeof(DateTime));
        dt.Columns.Add("EmpName", typeof(string));
        dt.Columns.Add("RequisitionNo", typeof(string));
        dt.Columns.Add("RequisitionDate", typeof(DateTime));
        dt.Columns.Add("RequisitionCafeId", typeof(Int32));
        dt.Columns.Add("IssueRegisterId", typeof(Int32));

        dr                      = dt.NewRow();
        dr["#"]                 = 0;
        dr["IssueNo"]           = "";
        dr["IssueDate"]         = DateTime.Now.ToString("dd-MMM-yyyy");
        dr["EmpName"]           = "";
        dr["RequisitionNo"]     = "";
        dr["RequisitionDate"]   = DateTime.Now.ToString("dd-MMM-yyyy");
        dr["RequisitionCafeId"] = 0;
        dr["IssueRegisterId"]   = 0;

        dt.Rows.Add(dr);
        ViewState["ItemDetails"] = dt;
        GrdReport.DataSource     = dt;
        GrdReport.DataBind();
    }
Exemple #10
0
    public void ReportGrid(string RepCondition)
    {
        try
        {
            DataTable dt = db.Displaygrid("select   id as #   , ProjectName, Comapanyid , Customer , ProjectstartDate , ProjectEndDate  from  Project_master");
            DS.Tables.Add(dt);
            if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
            {
                GrdReport.DataSource = DS.Tables[0];
                GrdReport.DataBind();
            }
            else
            {
                GrdReport.DataSource = null;
                GrdReport.DataBind();
            }

            ddlcompany.DataSource     = db.Displaygrid("select 0 as CompanyId,' --Select Company--' as CompanyName union       select CompanyId, CompanyName from CompanyMaster where IsDeleted = 0");
            ddlcompany.DataValueField = "CompanyId";
            ddlcompany.DataTextField  = "CompanyName";
            ddlcompany.DataBind();
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Exemple #11
0
    protected void SetInitialRowReportGrid()
    {
        try
        {
            DataTable dt = new DataTable();
            DataRow   dr = null;

            dt.Columns.Add(new DataColumn("#", typeof(string)));
            dt.Columns.Add(new DataColumn("PMNo", typeof(string)));
            dt.Columns.Add(new DataColumn("Property", typeof(string)));
            dt.Columns.Add(new DataColumn("PMDate", typeof(string)));

            dr             = dt.NewRow();
            dr["#"]        = "";
            dr["PMNo"]     = "";
            dr["Property"] = "";
            dr["PMDate"]   = "";

            dt.Rows.Add(dr);

            ViewState["GrdReport"] = dt;
            GrdReport.DataSource   = dt;
            GrdReport.DataBind();

            dt = null;
            dr = null;
        }
        catch (Exception)
        {
            throw;
        }
    }
Exemple #12
0
    public void ReportGrid(string RepCondition)
    {
        try
        {
            Ds = new DataSet();
            DMEmployeeMaster obj_DMCustomerMaster = new DMEmployeeMaster();
            Ds = obj_Emp.GetEmployee(RepCondition, out StrError);
            if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
            {
                ViewState["CurrentTable1"] = Ds.Tables[0];
                GrdReport.DataSource       = Ds.Tables[0];
                GrdReport.DataBind();
                if (Ds.Tables[1].Rows.Count > 0)
                {
                    ViewState["EmpCode"] = Ds.Tables[1].Rows[0][0].ToString();
                    txtEmpCode.Text      = ViewState["EmpCode"].ToString();
                }

                //rptPages.Visible = false;
            }
            else
            {
                GrdReport.DataSource = null;
                GrdReport.DataBind();
            }
            // obj_DMCustomerMaster = null;
            Ds = null;
        }
        catch (Exception ex)
        {
            obj_Comman.ShowPopUpMsg(ex.Message, this.Page);
        }
    }
    private void ShowReport()
    {
        DataSet       ds       = new DataSet();
        StringBuilder strTable = new StringBuilder();

        ObjRPT.UserName = Membership.GetUser().UserName.ToString();
        ObjRPT.Fromdate = Convert.ToDateTime(ddlMonth.SelectedValue + "/01/" + ddlYear.SelectedValue);
        ObjRPT.Todate   = ObjRPT.Fromdate.AddMonths(1);
        if (ChkIsBranch.Checked)
        {
            ObjRPT.IsBranchWise = true;
        }
        else
        {
            ObjRPT.IsBranchWise = false;
        }

        ds = ObjRPT.FetchReport();
        if (ds.Tables[0].Rows.Count > 0)
        {
            btnExport.Visible = true;
        }
        else
        {
            btnExport.Visible = false;
        }

        GrdReport.DataSource = ds;
        GrdReport.DataBind();
        ds.Dispose();
        GrdReport.Dispose();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            txtFromDate.Text = System.DateTime.Now.ToString("dd/MM/yyyy");
            txtToDate.Text   = System.DateTime.Now.ToString("dd/MM/yyyy");

            GrdReport.DataSource = db.Displaygrid("select   distinct(Enquirydetails.supplier) , (enquirymaster.id) as #,    Enquirydetails.reamrk , enquirymaster.date , enquirymaster.enno from Enquirydetails  inner join enquirymaster   on enquirymaster.enno=Enquirydetails.enno  order by enquirymaster.enno  desc");
            GrdReport.DataBind();
        }
    }
Exemple #15
0
    public void FilterPPRId(string name)
    {
        if (!string.IsNullOrEmpty(name))
        {
            DataTable dt = (DataTable)ViewState["DataList"];

            DataView dataView = dt.DefaultView;
            dataView.RowFilter   = "PPRId  like  '" + name + "%'";
            GrdReport.DataSource = dataView;
            GrdReport.DataBind();
        }
    }
Exemple #16
0
    protected void ImgBtnExport_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            DataSet DsGrid = new DataSet();
            StrCondition = string.Empty;

            if (Convert.ToInt32(ddlNo.SelectedValue) > 0)
            {
                StrCondition = StrCondition + " AND C.POId=" + Convert.ToInt32(ddlNo.SelectedValue);
            }
            if (Convert.ToInt32(ddlSupplier.SelectedValue) > 0)
            {
                StrCondition = StrCondition + " AND C.SuplierId=" + Convert.ToInt32(ddlSupplier.SelectedValue);
            }

            if (Convert.ToInt32(ddlSite.SelectedValue) > 0)
            {
                StrCondition = StrCondition + " AND C.IsCostCentre = " + Convert.ToInt32(ddlSite.SelectedValue);
            }
            DsGrd = Obj_PO.GetPOForExcessReport(StrCondition, out StrError);
            DsGrd.Tables[0].Columns.Remove("SuplierId");
            DsGrd.Tables[0].Columns.Remove("POId");
            DsGrd.Tables[0].Columns.Remove("IsCostCentre");
            DsGrd.Tables[0].Columns.Remove("#");
            DsGrd.Tables[0].Columns.Remove("ExcessApproved");
            DsGrd.Tables[0].Columns.Remove("ItemId");

            if (DsGrd.Tables.Count > 0 && DsGrd.Tables[0].Rows.Count > 0)
            {
                //========Call Register
                GridView GridExp = new GridView();
                GridExp.DataSource = DsGrd.Tables[0];
                GridExp.DataBind();
                Obj_Comm.Export("Purchase Order Excess Report.xls", GridExp);
            }
            else
            {
                Obj_Comm.ShowPopUpMsg("No Data Found To Export..!", this.Page);
                DsGrd.Dispose();
                GrdReport.DataSource = null;
                GrdReport.DataBind();
            }
            DsGrd = null;
        }
        catch (ThreadAbortException tex)
        {
        }
        catch (Exception ex)
        {
        }
    }
Exemple #17
0
    private void SetInitialRow()
    {
        try
        {
            DataTable dt = new DataTable();
            DataRow   dr = null;

            dt.Columns.Add(new DataColumn("#", typeof(Int32)));
            dt.Columns.Add(new DataColumn("SuplierId", typeof(Int32)));
            dt.Columns.Add(new DataColumn("ItemID", typeof(Int32)));
            dt.Columns.Add(new DataColumn("PONo", typeof(string)));
            dt.Columns.Add(new DataColumn("PODate", typeof(string)));
            dt.Columns.Add(new DataColumn("Supplier", typeof(string)));
            dt.Columns.Add(new DataColumn("ItemName", typeof(string)));
            dt.Columns.Add(new DataColumn("ItemDesc", typeof(string)));
            dt.Columns.Add(new DataColumn("POQTY", typeof(string)));
            dt.Columns.Add(new DataColumn("INQTY", typeof(string)));
            dt.Columns.Add(new DataColumn("BALQTY", typeof(string)));
            dt.Columns.Add(new DataColumn("InwardNo", typeof(string)));
            dt.Columns.Add(new DataColumn("Inwarddate", typeof(string)));

            dr = dt.NewRow();

            dr["#"]         = 0;
            dr["SuplierId"] = 0;
            dr["ItemID"]    = 0;
            dr["PONo"]      = "";
            dr["PODate"]    = "";
            dr["Supplier"]  = "";

            dr["ItemName"]   = "";
            dr["ItemDesc"]   = "";
            dr["POQTY"]      = "";
            dr["INQTY"]      = "";
            dr["BALQTY"]     = "";
            dr["InwardNo"]   = "";
            dr["Inwarddate"] = "";

            dt.Rows.Add(dr);
            ViewState["CurrentTable"] = dt;
            GrdReport.DataSource      = dt;
            GrdReport.DataBind();
            dt = null;
            dr = null;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Exemple #18
0
    private void SetInitialRow()
    {
        try
        {
            DataTable dt = new DataTable();
            DataRow   dr = null;

            dt.Columns.Add(new DataColumn("#", typeof(Int32)));
            dt.Columns.Add(new DataColumn("PONo", typeof(string)));
            dt.Columns.Add(new DataColumn("PODate", typeof(string)));
            dt.Columns.Add(new DataColumn("Supplier", typeof(string)));


            dt.Columns.Add(new DataColumn("SubTotal", typeof(decimal)));
            dt.Columns.Add(new DataColumn("Discount", typeof(decimal)));
            dt.Columns.Add(new DataColumn("Vat", typeof(decimal)));
            dt.Columns.Add(new DataColumn("GrandTotal", typeof(decimal)));
            dt.Columns.Add(new DataColumn("POStatus", typeof(string)));
            dt.Columns.Add(new DataColumn("GeneratedTime", typeof(string)));
            dt.Columns.Add(new DataColumn("ApprovedTime", typeof(string)));
            dt.Columns.Add(new DataColumn("AuthorizedTime", typeof(string)));

            dr = dt.NewRow();

            dr["#"]        = 0;
            dr["PONo"]     = "";
            dr["PODate"]   = "";
            dr["Supplier"] = "";

            dr["SubTotal"]       = 0;
            dr["Discount"]       = 0;
            dr["Vat"]            = 0;
            dr["GrandTotal"]     = 0;
            dr["POStatus"]       = "";
            dr["GeneratedTime"]  = "";
            dr["ApprovedTime"]   = "";
            dr["AuthorizedTime"] = "";

            dt.Rows.Add(dr);
            ViewState["CurrentTable"] = dt;
            GrdReport.DataSource      = dt;
            GrdReport.DataBind();
            dt = null;
            dr = null;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string MinistryName = ddlMinistry.SelectedItem.Text;
        string AgencyName   = ddlAgency.SelectedItem.Text;
        string MDBName      = ddlMDB.SelectedItem.Text;
        string Status       = ddlStatus.SelectedValue;

        //if (txtFromDate.Text.Length > 0 || txtToDate.Text.Length < 0)
        //{
        //    lblToDateMsg.Visible = true;
        //    lblToDateMsg.Text = "Please Select To Date";
        //    System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "HideLabel();", true);
        //}
        //if (txtFromDate.Text.Length < 0 || txtToDate.Text.Length > 0)
        //{
        //    lblFromDateMsg.Visible = true;
        //    lblFromDateMsg.Text = "Please Select From Date";
        //    System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "HideLabel();", true);
        if (Request.QueryString["ReportType"] != null)
        {
            reporttype = "Filter";
        }
        else
        {
            reporttype = "Mis";
        }
        //}
        if (txtPprId.Text == "" && txtProjectName.Text == "" && txtFromDate.Text == "" && txtToDate.Text == "" && MinistryName == "-----Select Ministry-----" && AgencyName == "----Select Agency----" && MDBName == "----Select MDB----" && Status == "----Select Status Of PPR----")
        {
            DisplayMisReportData("CompleteReportView", "", "", "", "", "", "", "", "", Session["UserId"].ToString(), Session["ministry"].ToString(), Session["Rolls"].ToString(), reporttype);
        }
        else if (txtPprId.Text != "" || txtProjectName.Text != "" || txtFromDate.Text != "" || txtToDate.Text != "" || MinistryName != "-----Select Ministry-----" || AgencyName != "----Select Agency----" || MDBName != "----Select MDB----" || Status != "----Select Status Of PPR----")
        {
            try
            {
                GrdReport.DataSource = null;
                GrdReport.DataBind();
                if (GrdReport.Rows.Count < 1)
                {
                    btnExportExcel.Visible = false;
                }
                DisplayMisReportData("FilterReportView", txtPprId.Text, txtProjectName.Text, ddlMinistry.SelectedValue.ToString(), ddlAgency.SelectedValue.ToString(), ddlMDB.SelectedValue.ToString(), ddlStatus.SelectedValue.ToString(), txtFromDate.Text, txtToDate.Text, Session["UserId"].ToString(), Session["ministry"].ToString(), Session["Rolls"].ToString(), null, reporttype);
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
        }
    }
Exemple #20
0
    protected void GrdReport_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        try
        {
            this.GrdReport.PageIndex = e.NewPageIndex;
            DataSet DS = new DataSet();
            StrCondition = string.Empty;
            string FromDate = string.Empty;
            string ToDate   = string.Empty;
            if (ChkFrmDate.Checked == true)
            {
                StrCondition = StrCondition + " and PO.PODate between'" + Convert.ToDateTime(txtFromDate.Text).ToString("MM-dd-yyyy") + "'And'" + Convert.ToDateTime(txtToDate.Text).ToString("MM-dd-yyyy") + "'";
            }
            else
            {
                StrCondition = StrCondition + "and PO.PODate between '01-01-1975' AND '" + DateTime.Now.ToString("MM-dd-yyyy") + "'";
            }
            if (Convert.ToInt32(ddlNo.SelectedValue) > 0)
            {
                StrCondition = StrCondition + " and PO.POId=" + Convert.ToInt32(ddlNo.SelectedValue);
            }
            if (Convert.ToInt32(ddlSupplier.SelectedValue) > 0)
            {
                StrCondition = StrCondition + " and PO.SuplierId=" + Convert.ToInt32(ddlSupplier.SelectedValue);
            }
            DsGrd = Obj_PO.GetPOForReport(StrCondition, out StrError);

            if (DsGrd.Tables.Count > 0 && DsGrd.Tables[0].Rows.Count > 0)
            {
                GrdReport.DataSource = DsGrd.Tables[0];
                GrdReport.DataBind();
                lblCount.Text    = DsGrd.Tables[0].Rows.Count + " Records Found";
                lblCount.Visible = true;
            }

            else
            {
                GrdReport.DataSource = null;
                GrdReport.DataBind();
                lblCount.Text    = DsGrd.Tables[0].Rows.Count + " Records Found";
                lblCount.Visible = true;
                SetInitialRow();
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }