コード例 #1
0
    public void BindRequisitionSummary()
    {
        TechnicalBAL objtechBAL = new TechnicalBAL();
        DataSet      dsReqSumm  = new DataSet();

        try
        {
            dsReqSumm = objtechBAL.GetRequisitionSummary(Request.QueryString["REQUISITION_CODE"].ToString(), Request.QueryString["document_code"].ToString(), Request.QueryString["Vessel_Code"].ToString());
            if (dsReqSumm.Tables[0].Rows.Count > 0)
            {
                lblReqsntype.Text     = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["ReqsnType"]);
                txtCatalogueCode.Text = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["System_Code"]);
                lblCatalog.Text       = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["Catalog"]);
                lblReqNo.Text         = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["RequistionCode"]);
                //lblTotalItem.Text = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["TotalItems"]);
                lblToDate.Text               = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["ToDate"]);
                lblFunction.Text             = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["DeptName"]);
                lblReason.Text               = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["ReqComents"]);
                lblDeliveryPort.Text         = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["DeliveryPort"]);
                lblDeliveryDate.Text         = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["DELIVERY_DATE"]);
                btnAccountType.Text          = "Account Type :" + " " + Convert.ToString(dsReqSumm.Tables[0].Rows[0]["VARIABLE_NAME"]);
                ddlAccountType.SelectedValue = dsReqSumm.Tables[0].Rows[0]["Account_Type"].ToString();
                chkSendTovessel.Checked      = Convert.ToBoolean(dsReqSumm.Tables[0].Rows[0]["Send_To_Vessel"]);

                ViewState["OnHold"] = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["OnHold"]);

                gvReqsnItems.DataSource = dsReqSumm.Tables[1];
                gvReqsnItems.DataBind();
                GridViewHelper helper = new GridViewHelper(this.gvReqsnItems);
                helper.RegisterGroup("Subsystem_Description", true, true);
                helper.GroupHeader += new GroupEvent(helper_GroupHeader);
                var Listselected = dsReqSumm.Tables[1].AsEnumerable().Select(r => r.Field <string>("ItemID")).ToArray();
                hdnSelectedCde.Value = string.Join(",", Listselected);


                rpAttachment.DataSource = dsReqSumm.Tables[2];
                rpAttachment.DataBind();
            }
            else
            {
                String msg = String.Format("alert('This Requisition is not valid !'); window.close();");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg156", msg, true);
            }
            if (UDFLib.ConvertToInteger(dsReqSumm.Tables[3].Rows[0][0].ToString()) > 0 && BLL_PURC_Common.Get_Bulk_Reqsn_Finalized(Request.QueryString["REQUISITION_CODE"]) > 0)
            {
                btnBulkPurchase.Enabled = true;
            }

            else
            {
                btnBulkPurchase.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
コード例 #2
0
    private void BindDataOnPostback()
    {
        DataSet dsReqSumm = objtechBAL.GetRequisitionSummary(Request.QueryString["REQUISITION_CODE"].ToString(), Request.QueryString["document_code"].ToString(), Request.QueryString["Vessel_Code"].ToString());

        rpAttachment.DataSource = dsReqSumm.Tables[2];
        rpAttachment.DataBind();
        gvReqsnItems.DataSource = dsReqSumm.Tables[1];
        gvReqsnItems.DataBind();
    }
コード例 #3
0
    protected void imgbtnExportReqsnItems_Click(object s, EventArgs e)
    {
        BindDataOnPostback();
        TechnicalBAL objtechBAL = new TechnicalBAL();
        DataSet      dsReqSumm  = new DataSet();

        dsReqSumm = objtechBAL.GetRequisitionSummary(Request.QueryString["REQUISITION_CODE"].ToString(), Request.QueryString["document_code"].ToString(), Request.QueryString["Vessel_Code"].ToString());

        DataTable dtexportdata = dsReqSumm.Tables[1];

        string[] HeaderCaptions  = new string[] { "Sr No", "Sub Catalogue", "Drawing Number", "Part Number", " Short Description", "Long Description", "Unit", "Requested Qty" };
        string[] DataColumnsName = new string[] { "SrNo", "Subsystem_Description", "Drawing_Number", "Part_Number", "ItemDesc", "Long_Description", "ItemUnit", "ReqestedQty" };
        string   FileHeaderName  = "Items of requisition number : " + Request.QueryString["REQUISITION_CODE"];
        string   FileName        = Request.QueryString["REQUISITION_CODE"];

        GridViewExportUtil.ShowExcel(dtexportdata, HeaderCaptions, DataColumnsName, FileName, FileHeaderName);
    }
コード例 #4
0
    public void imgbtnDelete_Click(object s, EventArgs e)
    {
        BindDataOnPostback();
        try
        {
            BLL_PURC_Purchase objAttch = new BLL_PURC_Purchase();

            int ID  = int.Parse(((ImageButton)s).CommandArgument.Split(new char[] { ',' })[0]);
            int res = objAttch.Purc_Delete_Reqsn_Attachments(ID);
            if (res > 0)
            {
                File.Delete(Server.MapPath(((ImageButton)s).CommandArgument.Split(new char[] { ',' })[1]));
            }

            LoadFiles(null, null);
            DataSet      dsReqSumm  = new DataSet();
            TechnicalBAL objtechBAL = new TechnicalBAL();
            dsReqSumm = objtechBAL.GetRequisitionSummary(Request.QueryString["REQUISITION_CODE"].ToString(), Request.QueryString["document_code"].ToString(), Request.QueryString["Vessel_Code"].ToString());
            rpAttachment.DataSource = dsReqSumm.Tables[2];
            rpAttachment.DataBind();
        }
        catch
        { }
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string       strRptPath = Server.MapPath(".");
        string       Selection  = Request.QueryString["RptType"].ToString();
        DataSet      dsReqSumm;
        TechnicalBAL objtechBAL;

        ConnectionInfo cInfo     = new ConnectionInfo();
        TableLogOnInfo logOnInfo = new TableLogOnInfo();

        string connstring = System.Configuration.ConfigurationManager.ConnectionStrings["smsconn"].ToString();

        string[] conn         = connstring.ToString().Split(';');
        string[] serverInfo   = conn[0].ToString().Split('=');
        string[] DbInfo       = conn[1].ToString().Split('=');
        string[] userInfo     = conn[2].ToString().Split('=');
        string[] passwordInfo = conn[3].ToString().Split('=');

        cInfo.ServerName   = serverInfo[1].ToString();
        cInfo.DatabaseName = DbInfo[1].ToString();
        cInfo.UserID       = userInfo[1].ToString();
        cInfo.Password     = passwordInfo[1].ToString();

        switch (Selection)
        {
        //For Requistion Summary
        case "ReqSumry":

            objtechBAL = new TechnicalBAL();
            dsReqSumm  = new DataSet();
            dsReqSumm  = objtechBAL.GetRequisitionSummary(Request.QueryString["REQUISITION_CODE"].ToString(), Request.QueryString["document_code"].ToString(), Request.QueryString["Vessel_Code"].ToString());
            ReportDocument rptSumryDoc = new ReportDocument();
            rptSumryDoc.Load(strRptPath + "\\RptRequisitionSummary.rpt");
            rptSumryDoc.OpenSubreport("Items").SetDataSource(dsReqSumm.Tables[1]);
            rptSumryDoc.SetDataSource(dsReqSumm.Tables[0]);
            SummaryReportViewer.ReportSource     = rptSumryDoc;
            SummaryReportViewer.DisplayGroupTree = false;
            SummaryReportViewer.DisplayToolbar   = true;

            break;

        //For Quotation  Summary
        case "QtnSumry":

            objtechBAL = new TechnicalBAL();
            dsReqSumm  = new DataSet();
            dsReqSumm  = objtechBAL.GetRequQuotationSummary(Request.QueryString["REQUISITION_CODE"].ToString(), Request.QueryString["document_code"].ToString(), Request.QueryString["Vessel_Code"].ToString(), Request.QueryString["QUOTATION_CODE"].ToString());

            ReportDocument rptSumryDocQtn = new ReportDocument();
            rptSumryDocQtn.Load(strRptPath + "\\RptQuotationSummary.rpt");
            rptSumryDocQtn.OpenSubreport("RptSubRFQSent").SetDataSource(dsReqSumm.Tables[3]);
            rptSumryDocQtn.OpenSubreport("RptSubQuotationReceived").SetDataSource(dsReqSumm.Tables[2]);
            rptSumryDocQtn.SetDataSource(dsReqSumm.Tables[0]);
            SummaryReportViewer.ReportSource     = rptSumryDocQtn;
            SummaryReportViewer.DisplayGroupTree = false;
            SummaryReportViewer.DisplayToolbar   = true;

            break;

        //For Delivery Order Summary
        case "DelvSumry":
            objtechBAL = new TechnicalBAL();
            dsReqSumm  = new DataSet();
            dsReqSumm  = objtechBAL.GetDeliveryOrderSummary(Request.QueryString["REQUISITION_CODE"].ToString(), Request.QueryString["document_code"].ToString(), Request.QueryString["Vessel_Code"].ToString(), Request.QueryString["DELIVERY_CODE"].ToString());

            ReportDocument rptSumryDelv = new ReportDocument();
            rptSumryDelv.Load(strRptPath + "\\RptDeliverOrderSummary.rpt");
            rptSumryDelv.OpenSubreport("RptSubDeliverOrderSummaryItem").SetDataSource(dsReqSumm.Tables[2]);
            rptSumryDelv.OpenSubreport("RptSubDeliverOrderSummaryAttachment").SetDataSource(dsReqSumm.Tables[1]);
            rptSumryDelv.SetDataSource(dsReqSumm.Tables[0]);
            SummaryReportViewer.ReportSource     = rptSumryDelv;
            SummaryReportViewer.DisplayGroupTree = false;
            SummaryReportViewer.DisplayToolbar   = true;

            break;
        }
    }