protected void Page_Load(object sender, EventArgs e)
    {
        TechnicalBAL objtechBAL = new TechnicalBAL();

        dtQTNReceived = objtechBAL.GetToopTipsForQtnRecve();
        dtQTNSent     = objtechBAL.GetToopTipsForQtnSent();

        if (!IsPostBack)
        {
            BindFleetDLL();
            DDLFleet.SelectedValue = Session["USERFLEETID"].ToString();
            BindVesselDDL();
            BindDeptTypeOpt();
            BindDepartmentByST_SP();
            //BindPendingStatas();
            rgdReqAllStage.Attributes.Add("bordercolor", "#D8D8D8");
            txtSearchJoinFromDate.Text = (DateTime.Now.AddDays(-(DateTime.Now.DayOfYear) + 1)).ToString("dd-MM-yyyy");
            txtSearchJoinToDate.Text   = (DateTime.Now.AddMonths(1).AddDays(-(DateTime.Now.Day))).ToString("dd-MM-yyyy");
            BindSearchRequistionstages();

            //txtSearchJoinFromDate.Text.Trim() == "" ? "1900/01/01" : txtSearchJoinFromDate.Text.Trim(),
            //txtSearchJoinToDate.Text.Trim() == "" ? "2099/01/01" : txtSearchJoinToDate.Text.Trim(),
        }
        objChangeReqstMerge.AddMergedColumns(new int[] { 2, 3, 4 }, "Requisition", "HeaderStyle-css");
        objChangeReqstMerge.AddMergedColumns(new int[] { 5, 6, 7, 8 }, "Quotation", "HeaderStyle-css");
        objChangeReqstMerge.AddMergedColumns(new int[] { 9, 10, 11, 12 }, "Purchase Order", "HeaderStyle-css");
        objChangeReqstMerge.AddMergedColumns(new int[] { 13, 14, 15 }, "Delivery", "HeaderStyle-css");
    }
예제 #2
0
    private void BindHeader()
    {
        TechnicalBAL objtechBAL = new TechnicalBAL();
        DataTable    dts        = new DataTable();

        dts = objtechBAL.GetRequsitionDetails(Request.QueryString["VCode"].ToString(), Request.QueryString["ReqCode"].ToString(), Request.QueryString["ReqStage"].ToString());
        if (Request.QueryString["ReqStage"].ToString() == "APR" || Request.QueryString["ReqStage"].ToString() == "ORD" || Request.QueryString["ReqStage"].ToString() == "DEO")
        {
            dts.DefaultView.RowFilter = "Order_Code='" + Request.QueryString["sOrderCode"].ToString() + "'";
        }
        else if (Request.QueryString["ReqStage"].ToString() == "INV")
        {
            dts.DefaultView.RowFilter = "Delivery_Code='" + Request.QueryString["sDelivery"].ToString() + "'";
        }
        if (dts.DefaultView.Count > 0)
        {
            lblFleet.Text      = dts.DefaultView[0]["Tech_Manager"].ToString();
            lblVessel.Text     = dts.DefaultView[0]["Vessel_Name"].ToString();
            lblDepartment.Text = dts.DefaultView[0]["Name_Dept"].ToString();

            lblRequsition.Text     = dts.DefaultView[0]["REQUISITION_CODE"].ToString();
            lblCatalogue.Text      = dts.DefaultView[0]["System_Description"].ToString();
            Session["sDocCode"]    = dts.DefaultView[0]["DOCUMENT_CODE"].ToString();
            Session["sSystemCode"] = dts.DefaultView[0]["System_Code"].ToString();
        }
    }
예제 #3
0
    public void BindDeliveryOrderSummary()
    {
        TechnicalBAL objtechBAL = new TechnicalBAL();
        DataSet      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());

        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"]);
        lblVessel.Text    = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["VesselName"]);
        txtComments.Text  = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["ReqComents"]);
        lblDelDate.Text   = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["DELIVERY_DATE"]);
        lblDelPort.Text   = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["PORT_NAME"]);

        rgdItems.DataSource = dsReqSumm.Tables[2];
        rgdItems.DataBind();

        rpAttachment.DataSource = dsReqSumm.Tables[1];
        rpAttachment.DataBind();

        gvItemsSupp.DataSource = dsReqSumm.Tables[3];
        gvItemsSupp.DataBind();
    }
예제 #4
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);
        }
    }
예제 #5
0
    /// <summary>
    /// Sent for Approval
    /// </summary>
    public void OnStsSaved(object s, EventArgs e)
    {
        try
        {
            TechnicalBAL objTechBAL    = new TechnicalBAL();
            string       QuotationCode = "";
            string       SupplierCode  = "";

            decimal Supp_Total_Amount = 0;
            decimal approvedAmount    = 0;
            dicTotalAmount.Clear();

            DataTable dtQuotationList = new DataTable();
            dtQuotationList.Columns.Add("Qtncode");
            dtQuotationList.Columns.Add("amount");

            CheckBox Chk = new CheckBox();
            foreach (GridViewRow gr in Grid_RqsnDtl.Rows)
            {
                Chk = (CheckBox)gr.FindControl("Chk_Item");

                if (Chk.Checked)
                {
                    Label lbl_Qnty = (Label)gr.FindControl("lbl_TotalPrice");
                    approvedAmount = Convert.ToDecimal(lbl_Qnty.Text) + approvedAmount;
                }
            }


            approvedAmount = approvedAmount + Convert.ToDecimal(hdfOrderAmounts.Value);



            SupplierCode  = hdfSupplierBeingApproved.Value;
            QuotationCode = hdfQTNCode.Value;


            Supp_Total_Amount = UDFLib.ConvertToDecimal(lbl_TotalAmount.Text);

            DataRow dtrow = dtQuotationList.NewRow();
            dtrow[0] = QuotationCode;
            dtrow[1] = dicTotalAmount[QuotationCode].ToString();
            dtQuotationList.Rows.Add(dtrow);

            // first send for approval
            int stsEntry = objTechBAL.InsertUserApprovalEntries(Requisitioncode, Document_Code, Vessel_Code, User, ucApprovalUser1.ApproverID, 0, 0, "", ucApprovalUser1.Remark, dtQuotationList);

            // save the approval
            objTechBAL.InsertUserApprovalEntries(Requisitioncode, Document_Code, Vessel_Code, User, User, Supp_Total_Amount, approvedAmount, "0", txtComment.Text.Trim(), dtQuotationList);
            String msg1 = String.Format("alert('Sent successfully.'); RefreshPendingDetails();window.close();");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgSENT", msg1, true);
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    public void BindRequisitionSummary()
    {
        TechnicalBAL objtechBAL = new TechnicalBAL();
        DataSet      dsReqSumm  = new DataSet();

        dsReqSumm          = objtechBAL.CancelledGetRequisitionSummary(Request.QueryString["REQUISITION_CODE"].ToString(), Request.QueryString["document_code"].ToString(), Request.QueryString["Vessel_Code"].ToString());
        lblDepartment.Text = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["DepartmentType"]);

        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"]);
        lblVessel.Text    = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["VesselName"]);
        txtComments.Text  = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["ReqComents"]);

        //-------Maker Details------
        //lblMarkerAdd.Text = dsReqSumm.Tables[0].Rows[0]["MakerAddress"].ToString();
        txtAddress.Text        = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["MakerAddress"]);
        lblMakerPh.Text        = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["MakerPhone"]);
        lblMakerName.Text      = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["MakerName"]);
        lblMakerExtension.Text = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["MakerTELEX"]);
        lblMakerEmail.Text     = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["MakerEmail"]);
        lblMakerContact.Text   = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["MakerCONTACT"]);
        lblMakerCity.Text      = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["MakerCity"]);

        lblModel.Text       = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["Model"]);
        lblParticulars.Text = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["Particulars"]);
        if (dsReqSumm.Tables[0].Rows[0]["Reqsn_Type"].ToString() != "0")
        {
            ddlReqsnType.Items.FindByValue(dsReqSumm.Tables[0].Rows[0]["Reqsn_Type"].ToString()).Selected = true;
        }
        if (dsReqSumm.Tables[0].Rows[0]["REQUISITION_ETA"].ToString() != "")//should be enable untill deliveru update
        {
            ddlReqsnType.Enabled = false;
        }
        //-------Vessel Details---------
        DataTable dtVesselDtl = objtechBAL.Get_VID_VesselDetails(UDFLib.ConvertToInteger(Request.QueryString["Vessel_Code"].ToString()));

        if (dtVesselDtl.Rows.Count > 0)
        {
            lblVesselExName1.Text = Convert.ToString(dtVesselDtl.Rows[0]["VesselExNames"]);
            //lblVesselExName2.Text = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["Vessel_Ex_Name2"]);
            lblVesselHullNo.Text   = Convert.ToString(dtVesselDtl.Rows[0]["Vessel_Hull_No"]);
            lblVesselType.Text     = Convert.ToString(dtVesselDtl.Rows[0]["Vessel_Type"]);
            lblVesselYard.Text     = Convert.ToString(dtVesselDtl.Rows[0]["Vessel_Yard"]);
            lblVesselDelvDate.Text = Convert.ToString(dtVesselDtl.Rows[0]["Vessel_Delvry_Date"]);
            lblIMOno.Text          = Convert.ToString(dtVesselDtl.Rows[0]["Vessel_IMO_No"]);
        }

        rgdItems.DataSource = dsReqSumm.Tables[1];
        rgdItems.DataBind();

        rpAttachment.DataSource = dsReqSumm.Tables[2];
        rpAttachment.DataBind();
    }
예제 #7
0
    /// <summary>
    /// Used to bind repeter of RFQ Sent,Quotation Recieve and Attachment
    /// </summary>

    public void BindQuotationSummary()
    {
        try
        {
            TechnicalBAL objtechBAL = new TechnicalBAL();
            DataSet      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());
            if (dsReqSumm.Tables[0].Rows.Count > 0)
            {
                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"]);
                lblVessel.Text    = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["VesselName"]);
                txtComments.Text  = Convert.ToString(dsReqSumm.Tables[0].Rows[0]["ReqComents"]);

                //--File Attachements.
                rpAttachment.DataSource = dsReqSumm.Tables[1];
                rpAttachment.DataBind();

                //----Quotation Sent


                RepeaterRfqSent.DataSource = dsReqSumm.Tables[3];
                RepeaterRfqSent.DataBind();

                //----Quotation Received


                RepeaterQtnRcv.DataSource = dsReqSumm.Tables[2];
                RepeaterQtnRcv.DataBind();


                foreach (RepeaterItem item in RepeaterQtnRcv.Items)
                {
                    if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                    {
                        System.Web.UI.HtmlControls.HtmlTableCell tdOrderLabel = (System.Web.UI.HtmlControls.HtmlTableCell)item.FindControl("tdOrderLabel");

                        tdOrderLabel.Visible = false;
                    }
                }



                ViewState["QuotationItemsDetails"] = true;
                ViewState["QuotationItemsDetails"] = dsReqSumm.Tables[4];
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
예제 #8
0
    protected void BindFunction()
    {
        TechnicalBAL objtechBAL = new TechnicalBAL();
        DataTable    dt         = BLL_PURC_Common.Get_Function(UDFLib.ConvertToInteger(GetSessionUserID()), UDFLib.ConvertToInteger(ddlReqsnType.SelectedValue));

        ddlFunction.DataTextField  = "Function_Name";
        ddlFunction.DataValueField = "ID";
        ddlFunction.DataSource     = dt;
        ddlFunction.DataBind();
        ddlFunction.Items.Insert(0, new ListItem("-SELECT-", "0"));
    }
    protected int SaveItems()
    {
        string FinalQuery = HiddenQuery.Value;
        int    retVal     = 0;

        if (FinalQuery != "")
        {
            TechnicalBAL objtechBAL = new TechnicalBAL();
            retVal = objtechBAL.ExecuteQuery(FinalQuery);
        }
        return(retVal);
    }
예제 #10
0
    protected void OnStsSavedSentToApprover(object s, EventArgs e)
    {
        try
        {
            TechnicalBAL objpurc    = new TechnicalBAL();
            TechnicalBAL objTechBAL = new TechnicalBAL();

            //qtnbased
            DataTable dtQuotations    = BLL_PURC_Common.PURC_GET_Quotation_ByReqsnCode(Requisitioncode);
            DataTable dtQuotationList = new DataTable();
            dtQuotationList.Columns.Add("Qtncode");
            dtQuotationList.Columns.Add("amount");

            foreach (DataRow dr in dtQuotations.Rows)
            {
                if (dr["active_PO"].ToString() == "0") // for those POs have been cancelled(means active_PO is zero)
                {
                    DataRow dtrow = dtQuotationList.NewRow();
                    dtrow[0] = dr["QUOTATION_CODE"].ToString();
                    dtrow[1] = "0";
                    dtQuotationList.Rows.Add(dtrow);
                }
            }

            // save the requested qty into order qty and order qty column on grid will be bibnded to order qty (change so store the updated qty by supp at the time of eval.) { this functionality has been implemented at rfq send stage}
            // code to update the order qty have been commented ,this is used to save bgt code only.

            BLL_PURC_Common.Update_OrderQty_From_ReqstQty(Requisitioncode, Document_Code, ddlBGTCodeToSuppdt.SelectedValue);

            int stsEntry = objTechBAL.InsertUserApprovalEntries(Requisitioncode, Document_Code, Vessel_Code, User, ucApprovalUserToSuppdt.ApproverID, 0, 0, "", ucApprovalUserToSuppdt.Remark, dtQuotationList);
            if (stsEntry > 0)
            {
                // dtQuotationList is passing but not using in sp ,all quotation will be set as senttosuppdt as true for this reqsn
                int res = objpurc.PURC_Update_SentToSupdt(0, 0, Requisitioncode, int.Parse(User), ucApprovalUserToSuppdt.Remark, dtQuotationList);

                if (res > 0)
                {
                    BLL_PURC_Purchase objPurc = new BLL_PURC_Purchase();
                    //Requisition stage status update
                    objPurc.InsertRequisitionStageStatus(Requisitioncode, Vessel_Code, Document_Code, "QEV", " ", Convert.ToInt32(User), dtQuotationList);
                    BLL_PURC_Common.INS_Remarks(Document_Code, Convert.ToInt32(User), ucApprovalUserToSuppdt.Remark, 302);

                    String msg = String.Format("alert('Sent successfully'); RefreshPendingDetails();window.close();");
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            objsrcReqsnType.Select();
            ddlReqsnType.DataBind();
            BindRequisitionSummary();
            TechnicalBAL objpurch = new TechnicalBAL();


            gvCrewList.DataSource = objpurch.Get_CrewList(UDFLib.ConvertToInteger(Request.QueryString["Vessel_Code"].ToString()));
            gvCrewList.DataBind();
            BindReqsTypeLog();
        }
    }
예제 #12
0
 /// <summary>
 /// Checking Sessoion Value
 /// </summary>
 public void BindGrid()
 {
     try
     {
         TechnicalBAL objLog = new TechnicalBAL();
         if (Session["ReqsnCancelLog"] != null)
         {
             gvCancelLog.DataSource = objLog.Get_ReqsnCancelLog(Session["ReqsnCancelLog"].ToString());
             gvCancelLog.DataBind();
             Session["ReqsnCancelLog"] = "0";
         }
     }
     catch (Exception ex)
     {
         UDFLib.WriteExceptionLog(ex);
     }
 }
예제 #13
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);
    }
예제 #14
0
 protected void btnAccountTypeSave_Click(object s, EventArgs e)
 {
     try
     {
         TechnicalBAL objtechBAL = new TechnicalBAL();
         objtechBAL.Update_AccountType(Request.QueryString["REQUISITION_CODE"].ToString(), ddlAccountType.SelectedValue, txtTypeRemark.Text, UDFLib.ConvertToInteger(GetSessionUserID()));
         BindRequisitionSummary();
         //BindReqsTypeLog();
         txtTypeRemark.Text = string.Empty;
         string hidemodal = String.Format("hideModal('dvAccountType')");
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
     }
     catch (Exception ex)
     {
         UDFLib.WriteExceptionLog(ex);
     }
 }
예제 #15
0
    /// <summary>
    /// This Method is used to bind additional details RFQ RECIEVE
    /// </summary>
    /// <param name="Quotation_Code"></param>
    public void BindAdditionalDetails(string Quotation_Code)
    {
        try
        {
            TechnicalBAL    objtechBAL = new TechnicalBAL();
            clsQuotationBLL objQuoBLL  = new clsQuotationBLL();

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


            if (dsReqSumm.Tables[5].Rows.Count > 0)
            {
                lblMaker.Text             = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Maker"]);
                lblSystemParticulars.Text = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Particulars"]);
                lblModel.Text             = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Model"]);
                lblSerialNumber.Text      = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["System_Serial_Number"]);
                lblBargeWorkboatCost.Text = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Barge_Workboat_Cost"]);
                lblTruckCost.Text         = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Truck_Cost"]);
                lblOtherCost.Text         = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Other_Charges"]);
                lblROC.Text = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Other_Charges_Reason"]);
                lblTruckingFreightCost.Text = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Freight_Cost"]);
                lblPKGHandlingCost.Text     = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Packing_Handling_Charges"]);

                lblTotalDiscount.Text = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["DISCOUNT"]);
                lblSQR.Text           = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["Supplier_Quotation_Reference"]);
                lblSRemark.Text       = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["QUOTATION_REMARKS"]);
                lblReasonPHC.Text     = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["REASON_TRANS_PKG"]);
                lblAccountCode.Text   = Convert.ToString(dsReqSumm.Tables[5].Rows[0]["ACCOUNT_CODE"]);
            }
            if (dsReqSumm.Tables[6].Rows.Count > 0)
            {
                lblVATGST.Text = Convert.ToString(dsReqSumm.Tables[6].Rows[0]["Vat"]);
            }
            if (dsReqSumm.Tables[7].Rows.Count > 0)
            {
                lblTotalPrice.Text = Math.Round(Convert.ToDecimal(dsReqSumm.Tables[7].Rows[0]["TotalPrice"]), 2).ToString();
            }

            CalculateDiscount();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
예제 #16
0
    protected void SendTovessel()
    {
        if (chkSendTovessel.Checked == true)
        {
            TechnicalBAL objpurch = new TechnicalBAL();

            objpurch.Insert_sendToVessel(Request.QueryString["document_code"].ToString(), Request.QueryString["REQUISITION_CODE"].ToString(), 1);
            btnSendToVessel.Enabled = false;
            chkSendTovessel.Enabled = false;

            int sts = objpurch.Get_SendToVessel(Request.QueryString["document_code"].ToString(), Request.QueryString["REQUISITION_CODE"].ToString());
            if (sts == 1 || !Request.QueryString["REQUISITION_CODE"].Contains("-O"))
            {
                chkSendTovessel.Enabled = false;
                btnSendToVessel.Enabled = false;
            }

            String msg = String.Format("alert('Requisition has been sent to vessel'); ");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgsentreq", msg, true);
        }
    }
예제 #17
0
    public void BindSubCatalogueMechDetails()
    {
        TechnicalBAL objtechBAL = new TechnicalBAL();
        DataSet      dsReqSumm  = new DataSet();

        dsReqSumm = objtechBAL.GetSubCatalogueDetails(Request.QueryString["Requisition_code"].ToString(), Request.QueryString["Catalogue_Code"].ToString(), Request.QueryString["Vessel_ID"].ToString());
        if (dsReqSumm.Tables[0].Rows.Count > 0)
        {
            gvSubCatalogueDetails.DataSource = dsReqSumm.Tables[0];
            gvSubCatalogueDetails.DataBind();


            //gvSubcatelogDetails.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);
        }
    }
예제 #18
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            string st = txtCompanyName.Text;

            IFormatProvider provider          = new System.Globalization.CultureInfo("en-CA", true);
            DateTime        HSEQSubmittedDate = DateTime.Parse(txtHSEQSubmittedDate.Text.Trim(), provider, System.Globalization.DateTimeStyles.NoCurrentDateDefault);

            TechnicalBAL objbal = new TechnicalBAL();
            int          x      = objbal.ins_ASL_DTL_Supplier_HSEQ(
                Session["SupplierCode"].ToString(), txtCompanyName.Text.Trim(), txtOperations.Text.Trim(), txtAddress.Text.Trim(), txtCountry.Text.Trim(),
                txtPhone.Text.Trim(), txtFax.Text.Trim(), txtEmail.Text.Trim(), txtWebsiet.Text.Trim(), txtPIC.Text.Trim(), txtEmergencyContactNo.Text.Trim(),
                txtSizeTurnover.Text.Trim(), txtAgeOfBusiness.Text.Trim(), txtServicesProvided.Text.Trim(), "", ddlRegulatoryControl.Text.Trim(),
                txtRegulatoryControlRemarks.Text.Trim(), txtCustomer1Name.Text.Trim(), txtCustomer2Name.Text.Trim(), txtCustomer3Name.Text.Trim(), txtCustomer1Years.Text.Trim(),
                txtCustomer2Years.Text.Trim(), txtCustomer3Years.Text.Trim(), txtServiceDescription1.Text.Trim(), txtServiceDescription2.Text.Trim(), txtServiceDescription3.Text.Trim(), Convert.ToInt32(txtHoursWorkedYTD.Text.Trim()),
                Convert.ToInt32(txtHoursWorked2Yrs.Text.Trim()), Convert.ToInt32(txtFatalInjuriesYTD.Text.Trim()), Convert.ToInt32(txtFatalInjuries2Yrs.Text.Trim()), Convert.ToInt32(txtLostDayInjuriesYTD.Text.Trim()),
                Convert.ToInt32(txtLostDayInjuries2Yrs.Text.Trim()), Convert.ToInt32(txtIncidenceRateYTD.Text.Trim()), Convert.ToInt32(txtIncidenceRate2Yrs.Text.Trim()), txtGovernmentInsp3Yrs.Text.Trim(), txtSignificantIncidents3Yrs.Text.Trim(),
                ddlInsuranceIndemity.Text.Trim(), txtInsuranceIndemityRemarks.Text.Trim(), ddlQualityAssurance.Text.Trim(), txtQualityAssuranceRemarks.Text.Trim(), "",
                ddlTrainingNewEmployees.Text.Trim(), txtTrainingNewEmployeesRemarks.Text.Trim(), ddlTrainingExisitingEmployees.Text.Trim(), txtTrainingExisitingEmployeesRemarks.Text.Trim(),
                txtClientList.Text.Trim(), ddlIncidentReporting.Text.Trim(), txtIncidentReportingRemarks.Text.Trim(), ddlNearMissReporting.Text.Trim(), txtNearMissReportingRemarks.Text.Trim(),
                ddlSafetyEquipment.Text.Trim(), txtSafetyEquipmentRemarks.Text.Trim(), "", ddlEmployeeEquipTraining.Text.Trim(),
                txtEmployeeEquipTrainingRemarks.Text.Trim(), txtContractorEquipTrainingRemark.Text.Trim(), ddlContractorEquipTraining.Text.Trim(),
                ddlCleanWorkingEnvironment.Text.Trim(), txtCleanWorkingEnvironmentRemarks.Text.Trim(), ddlEquipmentCalibration.Text.Trim(), ddlCalibrationCertificates.Text.Trim(),
                txtEquipmentCalibrationRemarks.Text.Trim(), txtCalibrationCertificatesRemarks.Text.Trim(), txtClientFamiliarizationVisitsRemarks.Text.Trim(), ddlClientFamiliarizationvisits.Text.Trim(),
                ddlMeetStandardRequirements.Text.Trim(), txtMeetStandardRequirementsRemarks.Text.Trim(), HSEQSubmittedDate, txtHSEQSubmittedBy.Text.Trim(),
                ddlESMCompetitiveQuote.Text.Trim(), txtESMCompetitiveQuoteRemarks.Text.Trim(), ddlESMQuickResponsee.Text.Trim(), txtESMQuickResponseRemarks.Text.Trim(),
                ddlESMOntimeDelivery.Text.Trim(), txtESMOntimeDeliveryRemarks.Text.Trim(), ddlESMPromptAdvice.Text.Trim(), txtESMPromptAdviceRemarks.Text.Trim(),
                10);

            if (x > 0)
            {
                String msg = String.Format("alert('HSE Questionnaire save successfully.');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
            }
        }
        catch //(Exception ex)
        {
        }
    }
예제 #19
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try

        {
            String msgApp = "";

            if (dlistPONumber.Items.Count < 1)
            {
                DataTable dtQuotationList = new DataTable();
                dtQuotationList.Columns.Add("Qtncode");
                dtQuotationList.Columns.Add("amount");

                TechnicalBAL      objPurc        = new TechnicalBAL();
                BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase();
                objPurc.Update_CancelReqsn(ReqsnNumber, DocCode, txtRemark.Text.Trim(), UDFLib.ConvertToInteger(Session["USERID"].ToString()));
                objTechService.InsertRequisitionStageStatus(ReqsnNumber, VesselCode, DocCode, "RCAN", " ", Convert.ToInt32(Session["USERID"]), dtQuotationList);
                BLL_PURC_Common.INS_Remarks(DocCode, Convert.ToInt32(Session["userid"].ToString()), txtRemark.Text.Trim(), 307);

                ReqsnNumber = "";
                DocCode     = "0";
                VesselCode  = "0";
            }
            else
            {
                msgApp = String.Format("alert('Delete operation can not be performed because this requisition has active PO.');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msgApp, true);
            }
            //msgApp = String.Format("location.reload(true);");
            msgApp = String.Format("this.close();");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msgApp, true);
        }
        catch (Exception ex)
        {
            String msgApp = String.Format("alert('" + ex.Message + "');");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msgApp, true);
        }
    }
    protected string BindToolTipsSuppNameOnQtnSent(string QuotCode, string DocCode, string VesselCode)
    {
        DataTable    dtToolTipsQtnSent = new DataTable();
        TechnicalBAL objtechBAL        = new TechnicalBAL();
        string       strTootips        = "";

        dtToolTipsQtnSent = dtQTNSent;
        dtToolTipsQtnSent.DefaultView.RowFilter = "Document_code='" + DocCode + "' and Vessel_Code='" + VesselCode + "'";
        dtToolTipsQtnSent = dtToolTipsQtnSent.DefaultView.ToTable();
        int i = 0;

        if (dtToolTipsQtnSent.Rows.Count > 0)
        {
            foreach (DataRow dr in dtToolTipsQtnSent.Rows)
            {
                //strTootips = strTootips + i + ")" + dr[0].ToString() + "<br>";
                //strTootips = strTootips + i.ToString();// +")" + dr[0] + "<br>";
                i += 1;
            }
        }

        return(i.ToString());
    }
예제 #21
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
        { }
    }
예제 #22
0
    protected void OnConfirm(object sender, CommandEventArgs e)
    {
        try
        {
            DataTable dtQuotationList = new DataTable();
            dtQuotationList.Columns.Add("Qtncode");
            dtQuotationList.Columns.Add("amount");

            string[] strIds       = e.CommandArgument.ToString().Split(',');
            string   reqCode      = strIds[0].ToString();
            string   DocumentCode = strIds[1].ToString();
            string   vesselCode   = strIds[2].ToString();
            string   SupplierCode = strIds[3].ToString();
            string   OrdCode      = strIds[4].ToString();
            string   QuotCode     = strIds[5].ToString();

            DataRow dtrow = dtQuotationList.NewRow();
            dtrow[0] = strIds[5].ToString();
            dtrow[1] = "0";
            dtQuotationList.Rows.Add(dtrow);

            TechnicalBAL      objTechBAL = new TechnicalBAL();
            int               insRec     = objTechBAL.UpdatePOConfirmation(reqCode, DocumentCode, SupplierCode, vesselCode, OrdCode, QuotCode);
            BLL_PURC_Purchase objPurc    = new BLL_PURC_Purchase();
            objPurc.InsertRequisitionStageStatus(reqCode, vesselCode, DocumentCode, "UPD", " ", Convert.ToInt32(Session["USERID"]), dtQuotationList);
            String msg = String.Format("alert('Order has been Confirmed'); window.close();");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);

            ucCustomPagerItems.isCountRecord = 1;
            BindData();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
예제 #23
0
    private void BindGridOnRetriveButtonClick()
    {
        int suppSel = 0;

        string[] arrySuppName       = new string[] { "", "", "", "", "", "", "", "", "", "" };
        string[] arrSuppNameInShort = new string[10];
        ViewState["suppliercode"]  = "";
        ViewState["quotationcode"] = "";
        ViewState["suppcurrency"]  = "";
        string SuppQtnCodesItemTypes = "";


        if (rgdQuatationInfo.MasterTableView.Columns.Count > 12)
        {
            //Remove all the programatically generated colomn from grid and
            for (int i = rgdQuatationInfo.MasterTableView.Columns.Count - 1; i >= 12; i--)
            {
                rgdQuatationInfo.MasterTableView.Columns.RemoveAt(i);
            }
        }
        if (Request.QueryString["Requisitioncode"].ToString().Substring(0, 2) == "ST" || Request.QueryString["Requisitioncode"].ToString().Substring(0, 3) == "OST")
        {
            rgdQuatationInfo.MasterTableView.Columns[3].Display = false;
        }
        StringBuilder strSql    = new StringBuilder();
        StringBuilder strTables = new StringBuilder();
        decimal       MinValues = 0;
        int           col_id    = 11;
        int           sel_Id    = 0;
        string        supplist  = "";

        //  HiddenChepSupp.Value = 0;
        // strSql.Append("select distinct a.ITEM_SERIAL_NO,'False' chechstatus, a.QUOTATION_CODE,a.ITEM_REF_CODE, a.ITEM_SHORT_DESC,a.ITEM_FULL_DESC,a.QUOTED_UNIT_ID,a.QUOTED_QTY");
        strSql.Append(@"select distinct a.ITEM_SERIAL_NO
                        ,'False' chechstatus
                        , a.QUOTATION_CODE
                        ,a.ITEM_REF_CODE
                        , a.ITEM_SHORT_DESC
                        ,a.ITEM_FULL_DESC
                        ,a.QUOTED_QTY
                        ,case when item.Drawing_Number='0' then '' else item.Drawing_Number end Drawing_Number
                        ,Item.Part_Number,isnull(Item.Long_Description,'') Long_Description
                        , M.ITEM_COMMENT 
                        ,item.Unit_and_Packings
                        ,M.ROB_Qty
                        ,M.REQUESTED_QTY
                        ,M.ORDER_QTY
                        ,isnull(M.ITEM_INTERN_REF,0) as ITEM_INTERN_REF
                        ,a.Vessel_Code
                        ,PURC_LIB_SUBSYSTEMS.Subsystem_Description
                        ,'" + lblCatalog.Text.Trim() + @"' as Catalogue
                        , '" + lblReqNo.Text.Trim() + "' as Reqsnno");
        // strTables.Append(" from PURC_Dtl_Quoted_Prices a ");
        strTables.Append(@"  from PURC_Dtl_Quoted_Prices a 
                            inner  join PURC_Lib_Items item On item.Item_Intern_Ref=A.Item_Ref_Code 
                            inner join PURC_Dtl_Supply_Items M on M.item_ref_code=A.item_ref_code and M.Document_Code=a.Document_Code and a.Vessel_Code=M.Vessel_Code 
                            inner join PURC_LIB_SUBSYSTEMS on PURC_LIB_SUBSYSTEMS.Subsystem_Code  =M.ITEM_SUBSYSTEM_CODE and PURC_LIB_SUBSYSTEMS.System_Code=M.ITEM_SYSTEM_CODE ");

        string BackColor   = "";
        int    suppCountBG = 2;

        foreach (GridDataItem dataItem in rgdSupplierInfo.MasterTableView.Items)
        {
            string str = "";

            TextBox  txtgrdItemReqQty = (TextBox)(dataItem.FindControl("txtgrdItemReqstdQty") as TextBox);
            CheckBox chk = (CheckBox)(dataItem.FindControl("chkQuaEvaluated") as CheckBox);

            string PortName     = rgdSupplierInfo.MasterTableView.DataKeyValues[dataItem.ItemIndex]["PortName"].ToString();
            string suppcurrency = rgdSupplierInfo.MasterTableView.DataKeyValues[dataItem.ItemIndex]["Currency"].ToString();
            if ((chk.Checked))
            {
                if (suppCountBG % 2 == 0)// assigne the different color to suppliers
                {
                    BackColor = "QtnEval-ItemStyle-css";
                }
                else
                {
                    BackColor = "QtnEval-AltItemStyle-css";
                }
                suppCountBG++;

                col_id = col_id + Convert.ToInt32(ViewState["ColumnCount_Supp"].ToString());

                string QUOTATION_CODE = dataItem["QUOTATION_CODE"].Text.ToString();
                string Col_supp       = dataItem["SUPPLIER"].Text.ToString().Replace('-', '_') + QUOTATION_CODE.Replace('-', '_');
                string Col_supp_Alias = "Supp" + dataItem["SUPPLIER"].Text.ToString().Trim() + dataItem.ItemIndex.ToString();
                string Col_supp_where = dataItem["SUPPLIER"].Text;

                string Col_supp_Short = dataItem["SHORT_NAME"].Text.ToString();
                string strColSupp     = "";
                if (Col_supp_Short.Length > Convert.ToInt32(ViewState["ColumnCount_Supp"].ToString()))
                {
                    for (int i = 0; i < Convert.ToInt32(ViewState["ColumnCount_Supp"].ToString()); i++)
                    {
                        strColSupp = strColSupp + Col_supp_Short[i];
                    }
                }
                else
                {
                    strColSupp = Col_supp_Short;
                }



                strSql.Append(",");
                strTables.Append(" Inner Join ");

                str = @"(select supl.ITEM_REF_CODE
                        ,( QUOTED_RATE * " + dataItem["EXCHANGE_RATE"].Text.ToString() + ") " + Col_supp_Alias + @"_Rate
                        ,QUOTED_PRICE " + Col_supp_Alias + @"_Price
                        ,QUOTED_DISCOUNT " + Col_supp_Alias + @"_Discount
                        , QUOTATION_REMARKS " + Col_supp_Alias + @"_Remark
                        , case when isnull(EVALUATION_OPTION,0)=1 then 'True' else 'False' end as " + Col_supp_Alias + @"_Status
                        ,QUOTATION_CODE
                        ,(((cast(QUOTED_RATE*" + dataItem["EXCHANGE_RATE"].Text.Trim() + " as decimal(18,2))*supl.ORDER_QTY)-(cast(QUOTED_RATE*" + dataItem["EXCHANGE_RATE"].Text.Trim() + " as decimal(18,2))*supl.ORDER_QTY*cast(QUOTED_DISCOUNT* " + dataItem["EXCHANGE_RATE"].Text.Trim() + " as decimal(18,2))/100))) " + Col_supp_Alias + @"_Amount
                        , isnull(Lead_Time,'') " + Col_supp_Alias + @"_Lead_Time
                        , [Description]" + Col_supp_Alias + @"_ItemType    
                        from PURC_Dtl_Quoted_Prices 
                        inner join PURC_DTL_SUPPLY_ITEMS supl on supl.DOCUMENT_CODE=PURC_Dtl_Quoted_Prices.DOCUMENT_CODE and supl.ITEM_REF_CODE=PURC_Dtl_Quoted_Prices.ITEM_REF_CODE  
                        inner join PURC_LIB_SYSTEM_PARAMETERS on Code=Item_Type 
                        where supplier_code='" + Col_supp_where
                      + "' and QUOTATION_CODE ='" + QUOTATION_CODE + "')  " + Col_supp_Alias + " on " + Col_supp_Alias + ".ITEM_REF_CODE = a.ITEM_REF_CODE ";
                if (col_id == 18)
                {
                    str += " and " + Col_supp_Alias + ".QUOTATION_CODE=a.QUOTATION_CODE ";
                }



                strTables.Append(str);
                strSql.Append(Col_supp_Alias);
                strSql.Append(".* ");
                // strSql.Append(" (select isnull(Description,'Original')as  Description from PURC_LIB_SYSTEM_PARAMETERS where Code=isnull(a.Item_Type,154) ) as ItemType ");

                GridBoundColumn boundColumn;
                boundColumn                           = new GridBoundColumn();
                boundColumn.HeaderText                = "Unit Price";
                boundColumn.DataField                 = Col_supp_Alias + "_Rate";
                boundColumn.UniqueName                = Col_supp + "_Rate";
                boundColumn.DataFormatString          = "{0:F2}";
                boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
                boundColumn.ItemStyle.CssClass        = BackColor;
                boundColumn.HeaderStyle.Width         = 70;
                boundColumn.ItemStyle.Width           = 70;

                rgdQuatationInfo.MasterTableView.Columns.Add(boundColumn);

                boundColumn                  = new GridBoundColumn();
                boundColumn.HeaderText       = "Discount";
                boundColumn.DataField        = Col_supp_Alias + "_Discount";
                boundColumn.UniqueName       = Col_supp + "_Discount";
                boundColumn.DataFormatString = "{0:F2}";

                boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
                boundColumn.ItemStyle.CssClass        = BackColor;
                boundColumn.HeaderStyle.Width         = 70;
                boundColumn.ItemStyle.Width           = 70;
                rgdQuatationInfo.MasterTableView.Columns.Add(boundColumn);

                boundColumn                  = new GridBoundColumn();
                boundColumn.HeaderText       = "Amount";
                boundColumn.DataField        = Col_supp_Alias + "_Amount";
                boundColumn.UniqueName       = Col_supp + "_Amount";
                boundColumn.DataFormatString = "{0:F2}";

                boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
                boundColumn.ItemStyle.CssClass        = BackColor;
                boundColumn.HeaderStyle.Width         = 70;
                boundColumn.ItemStyle.Width           = 70;
                rgdQuatationInfo.MasterTableView.Columns.Add(boundColumn);

                boundColumn            = new GridBoundColumn();
                boundColumn.HeaderText = "Lead days";
                boundColumn.DataField  = Col_supp_Alias + "_Lead_Time";
                boundColumn.UniqueName = Col_supp + "_Lead_Time";
                //  boundColumn.DataFormatString = "{0:F2}";

                boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
                boundColumn.ItemStyle.CssClass        = BackColor;
                boundColumn.HeaderStyle.Width         = 70;
                boundColumn.ItemStyle.Width           = 70;
                rgdQuatationInfo.MasterTableView.Columns.Add(boundColumn);


                boundColumn            = new GridBoundColumn();
                boundColumn.HeaderText = "ItemType";
                boundColumn.DataField  = Col_supp_Alias + "_ItemType";
                boundColumn.UniqueName = Col_supp + "_ItemType";
                boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
                boundColumn.ItemStyle.CssClass        = BackColor;
                boundColumn.HeaderStyle.Width         = 70;
                boundColumn.ItemStyle.Width           = 70;
                rgdQuatationInfo.MasterTableView.Columns.Add(boundColumn);



                GridTemplateColumn templateColumnRemark = new GridTemplateColumn();
                templateColumnRemark.HeaderText   = "Remark";
                templateColumnRemark.DataField    = Col_supp_Alias + "_Remark";
                templateColumnRemark.ItemTemplate = new DataGridTemplateImage(ListItemType.Item, Col_supp, Col_supp + "_Remark");
                templateColumnRemark.UniqueName   = Col_supp + "_img";
                templateColumnRemark.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                templateColumnRemark.ItemStyle.CssClass        = BackColor;
                templateColumnRemark.ItemStyle.Width           = 70;
                templateColumnRemark.HeaderStyle.Width         = 70;
                rgdQuatationInfo.MasterTableView.Columns.Add(templateColumnRemark);

                GridTemplateColumn templateColumn = new GridTemplateColumn();
                templateColumn.UniqueName                = "TempChk";
                templateColumn.HeaderTemplate            = new DataGridTempla(ListItemType.Header, Col_supp, "Select", "");
                templateColumn.ItemTemplate              = new DataGridTempla(ListItemType.Item, Col_supp, Col_supp, Col_supp_Alias + "_Status");
                templateColumn.UniqueName                = Col_supp + "_chk";
                templateColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                templateColumn.ItemStyle.CssClass        = BackColor;
                templateColumn.HeaderStyle.Width         = 70;
                templateColumn.ItemStyle.Width           = 70;
                rgdQuatationInfo.MasterTableView.Columns.Add(templateColumn);


                ViewState["Col_supp"]      = Col_supp;
                ViewState["Portname"]     += PortName + ",";
                ViewState["suppcurrency"] += suppcurrency + ",";
                ViewState["suppliercode"]  = ViewState["suppliercode"] + Col_supp_Alias + ",";
                ViewState["quotationcode"] = ViewState["quotationcode"] + QUOTATION_CODE + ",";
                SuppQtnCodesItemTypes     += " select '" + QUOTATION_CODE + "'  ";

                arrySuppName[suppSel] = Col_supp;
                supplist = Col_supp + "," + supplist;
                arrSuppNameInShort[suppSel] = strColSupp;


                suppSel += 1;
                if (MinValues == 0 || MinValues > Convert.ToDecimal(dataItem["Supp_Tot_Amt"].Text.ToString()))
                {
                    //HiddenChepSupp.Value = Col_supp + "_chk";
                    HiddenChepSupp.Value = Col_supp;
                    MinValues            = Convert.ToDecimal(dataItem["Supp_Tot_Amt"].Text.ToString());
                    sel_Id = col_id;
                }
            }
        }
        strSql.Append(" ");
        strSql.Append(strTables);
        Session["SubQuerry"] = strSql.ToString();
        strSql.Append("where  a.Document_code ='" + Request.QueryString["Document_Code"].ToString() + "' and a.active_status=1 order by a.ITEM_SERIAL_NO");

        SuppQtnCodesItemTypes = SuppQtnCodesItemTypes.Remove(SuppQtnCodesItemTypes.Length - 1, 1);
        dtItemsTypes          = BLL_PURC_Common.GET_ItemTypeAll(SuppQtnCodesItemTypes);

        DataTable dt = new DataTable();
        DataTable dtQuatationInfo = new DataTable();

        ViewState["SuppSelforEval"]      = suppSel;
        ViewState["supplierList"]        = arrySuppName;
        ViewState["supplierListInShort"] = arrSuppNameInShort;
        ViewState["EvaluateTable"]       = dtQuatationInfo;

        count = 0;
        // optEval.Attributes.Add("Onclick", "return CalculateByEvalOpt('" + EvalOpt + "'," +sel_Id+");");



        Session["supplist"] = supplist.ToString();



        TechnicalBAL objtechBAL = new TechnicalBAL();
        string       FinalQuery = strSql.ToString();

        dtQuatationInfo             = objtechBAL.GetTable(FinalQuery);
        rgdQuatationInfo.DataSource = dtQuatationInfo;
        rgdQuatationInfo.DataBind();
        Session["QuatationInfo"]  = dtQuatationInfo;
        Session["GeneratedQuery"] = FinalQuery;

        foreach (GridDataItem Item in rgdQuatationInfo.MasterTableView.Items)
        {
            int      suppCount = (int)ViewState["SuppSelforEval"];
            string[] arrSupp   = (string[])ViewState["supplierList"];



            count++;

            Label longDescpt = (Label)Item.FindControl("lblLongDesc");
            if (longDescpt.ToolTip == "1")
            {
                ((HyperLink)Item.FindControl("lblItemDesc")).CssClass = "NewItem";
                Item.Cells[8].BackColor = System.Drawing.Color.Yellow;
            }
        }

        ViewState["EvaluateTable"] = dtQuatationInfo;
        int column    = 14;
        int PortCount = 0;

        foreach (string supp in arrSuppNameInShort)
        {
            if (supp != "" && supp != null)
            {
                info.AddMergedColumns(new int[] { column, column + 1, column + 2, column + 3, column + 4, column + 5, column + 6 }, supp + "  (Port : " + ViewState["Portname"].ToString().Split(new char[] { ',' })[PortCount].ToString() + " ,Quoted Currency : " + ViewState["suppcurrency"].ToString().Split(new char[] { ',' })[PortCount].ToString() + ")");
                column += Convert.ToInt32(ViewState["ColumnCount_Supp"].ToString());
            }
            PortCount++;
        }
    }
예제 #24
0
    /// <summary>
    /// Show Approve Popup
    /// </summary>
    protected void btnApprove_Click(object sender, EventArgs e)
    {
        bool IsFinalAproved = false;

        try
        {
            string QuotationCode = "";
            string SupplierCode  = "";

            DataTable dtQuotationList_ForTopApprover = new DataTable();
            dtQuotationList_ForTopApprover.Columns.Add("Qtncode");
            dtQuotationList_ForTopApprover.Columns.Add("amount");

            DataTable dtQuotationList = new DataTable();
            dtQuotationList.Columns.Add("Qtncode");
            dtQuotationList.Columns.Add("amount");

            DataTable dtBudgetCode = new DataTable();
            dtBudgetCode.Columns.Add("Qtncode");
            dtBudgetCode.Columns.Add("amount");
            TechnicalBAL objTechBAL = new TechnicalBAL();

            string[] Attchment = new string[10];


            // check for provision's approval limit for items
            bool isProvisionLimitsts = isProvisionLimitExceeding();


            //Get Approval Amount

            BLL_PURC_Purchase objApproval = new BLL_PURC_Purchase();
            DataTable         dtApproval  = objApproval.Get_Approval_Limit(Convert.ToInt32(User), ViewState["Dept_Code"].ToString());
            if (dtApproval.Rows.Count < 1)
            {
                String msgApp = String.Format("alert('Approval limit does not exist for you.Please contact admin.');RefreshPendingDetails();window.close();");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg99011a", msgApp, true);
                //divApprove.Visible = false;
                String msgmodal = String.Format("hideModal('divApprove');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgonFinalmodalhide", msgmodal, true);
                return;
            }

            decimal dblPOAprLimitAmt = decimal.Parse(dtApproval.Rows[0]["Approval_Limit"].ToString());
            if (dblPOAprLimitAmt < 1)
            {
                String msgApp = String.Format("alert('Approval limit does not exist for you.Please contact admin.');RefreshPendingDetails() ;window.close();");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg660081g", msgApp, true);
                String msgmodal = String.Format("hideModal('divApprove');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgonFinalmodalhide", msgmodal, true);
                return;
            }

            TechnicalBAL objtechBAL = new TechnicalBAL();
            objtechBAL.Update_ReqsnType(Requisitioncode, UDFLib.ConvertToInteger(ddlReqsnType.SelectedValue), "", UDFLib.ConvertToInteger(User));

            decimal Supp_Total_Amount = 0;
            decimal approvedAmount    = 0;
            dicTotalAmount.Clear();

            CheckBox Chk = new CheckBox();
            foreach (GridViewRow gr in Grid_RqsnDtl.Rows)
            {
                Chk = (CheckBox)gr.FindControl("Chk_Item");

                if (Chk.Checked)
                {
                    Label lbl_Qnty = (Label)gr.FindControl("lbl_TotalPrice");
                    approvedAmount = Convert.ToDecimal(lbl_Qnty.Text) + approvedAmount;
                }
            }


            // add the orderedamount from existing POs in approved amount(amount going to be approved)
            approvedAmount = approvedAmount + Convert.ToDecimal(hdfOrderAmounts.Value);

            Supp_Total_Amount = decimal.Parse(hdfMaxQuotedAmount.Value);


            SupplierCode  = hdfSupplierBeingApproved.Value;
            QuotationCode = hdfQTNCode.Value;

            BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase();

            string retval = "TRUE";
            if (hdnBudgetCode.Value.ToString() == "1")
            {
                DataRow dtrow = dtBudgetCode.NewRow();
                dtrow[0] = QuotationCode;
                dtrow[1] = dicTotalAmount[QuotationCode].ToString();
                dtBudgetCode.Rows.Add(dtrow);
                retval = objTechService.Check_Update_BudgetCode(Requisitioncode, Vessel_Code, ddlBudgetCode.SelectedValue, dtBudgetCode);
            }

            if (retval == "TRUE")
            {
                if (Supp_Total_Amount > dblPOAprLimitAmt || approvedAmount > dblPOAprLimitAmt)// supplier code is zero in this case
                {
                    objApproval.POApproving(Requisitioncode, QuotationCode, "0", User, "", Vessel_Code, ddlBudgetCode.SelectedValue.ToString());

                    // store the qtn code and supp amount for top approver
                    DataRow dtrow = dtQuotationList_ForTopApprover.NewRow();
                    dtrow[0] = QuotationCode;
                    dtrow[1] = dicTotalAmount[QuotationCode].ToString();
                    dtQuotationList_ForTopApprover.Rows.Add(dtrow);
                }

                else if (Supp_Total_Amount <= dblPOAprLimitAmt && approvedAmount <= dblPOAprLimitAmt && (isProvisionLimitsts == false))//The actual approval
                {
                    //qtnbased

                    DataRow dtrow = dtQuotationList.NewRow();
                    dtrow[0] = QuotationCode;
                    dtrow[1] = dicTotalAmount[QuotationCode].ToString();
                    dtQuotationList.Rows.Add(dtrow);

                    /// begin insert the records for final PO
                    DataTable dtReqInfo = new DataTable();
                    dtReqInfo = objTechService.SelectSupplierToSendOrderEval(Requisitioncode, Vessel_Code, QuotationCode);
                    SavePurchasedOrder(dtReqInfo.DefaultView.ToTable());

                    objTechService.POApproving(Requisitioncode, QuotationCode, SupplierCode, User, txtComment.Text, Vessel_Code, ddlBudgetCode.SelectedValue.ToString());


                    IsFinalAproved = true;
                }
            }
            else
            {
                //btnRequestAmount.Visible = true;
                String msg1 = String.Format("alert('A.Total Approval amount is greater than Budget limit,Please request for increase Budget limit.');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg1, true);
                String msgmodal = String.Format("showModal('divApprove');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgonFinalmodal", msgmodal, true);
            }
            //}
            // }

            if (IsFinalAproved)
            {
                //Requisition stage status update
                // BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase();
                //Check Budget Code and Update
                retval = "TRUE";
                if (hdnBudgetCode.Value.ToString() == "1")
                {
                    retval = objTechService.Check_Update_BudgetCode(Requisitioncode, Vessel_Code, ddlBudgetCode.SelectedValue, dtBudgetCode);
                }

                if (retval == "TRUE")
                {
                    //btnRequestAmount.Visible = false;
                    // SAVE APPROVAL
                    objTechBAL.InsertUserApprovalEntries(Requisitioncode, Document_Code, Vessel_Code, User, User, Supp_Total_Amount, approvedAmount, "0", txtComment.Text.Trim(), dtQuotationList);

                    BLL_PURC_Common.INS_Remarks(Document_Code, Convert.ToInt32(User), txtComment.Text.Trim(), 303);
                    objTechService.InsertRequisitionStageStatus(Requisitioncode, Vessel_Code, Document_Code, "RPO", " ", Convert.ToInt32(User), dtQuotationList);

                    String msg1 = String.Format("alert('Approved successfully.'); RefreshPendingDetails(); window.close();");
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg1, true);
                    return;
                }
                else
                {
                    //btnRequestAmount.Visible = true;
                    String msg1 = String.Format("alert('B.Total Approval amount is greater than Budget limit,Please request for increase Budget limit.');");
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg1, true);
                    String msgmodal = String.Format("showModal('divApprove');");
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgonFinalmodal", msgmodal, true);
                }
            }

            else
            {
                if (!isProvisionLimitsts)
                {
                    //check if only one approver is left then send him directly instead of prompting the current user to send and save the current approver's approval.
                    //  BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase();
                    retval = "TRUE";
                    if (hdnBudgetCode.Value.ToString() == "1")
                    {
                        retval = objTechService.Check_Update_BudgetCode(Requisitioncode, Vessel_Code, ddlBudgetCode.SelectedValue, dtBudgetCode);
                    }

                    if (retval == "TRUE")
                    {
                        //btnRequestAmount.Visible = false;
                        int ApproverCount = BLL_PURC_Common.CheckHierarchy_SendForApproval(Requisitioncode, Document_Code, Convert.ToInt32(Vessel_Code), User, Supp_Total_Amount, dblPOAprLimitAmt, dtQuotationList_ForTopApprover);
                        if (ApproverCount == 1)
                        {
                            BLL_PURC_Common.INS_Remarks(Document_Code, Convert.ToInt32(User), txtComment.Text.Trim(), 303);
                            String msg = String.Format("alert('Approved successfully but  total Approval amount is greater than your approval limit ,this Requisition is now being sent to your supirior for his approval.'); RefreshPendingDetails();window.close();");
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg16", msg, true);
                        }
                        else if (ApproverCount > 1)
                        {
                            BLL_PURC_Common.INS_Remarks(Document_Code, Convert.ToInt32(User), txtComment.Text.Trim(), 303);
                            String msg1 = String.Format("alert('Approved successfully but  total Approval amount is greater than your approval limit ,this Requisition is now being sent to your supirior for his approval ');");
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg1, true);
                            ucApprovalUser1.ReqsnCode = Requisitioncode;


                            ucApprovalUser1.FillUser();
                            dvSendForApproval.Visible = true;
                        }
                        else if (ApproverCount == 0)
                        {
                            BLL_PURC_Common.INS_Remarks(Document_Code, Convert.ToInt32(User), txtComment.Text.Trim(), 303);
                            String msg1 = String.Format("alert('Total Approval amount is greater than your approval limit and no approver found for the amount " + Supp_Total_Amount + " . Please contact your manager.' );");
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgCt0", msg1, true);
                        }
                        String msgmoda12l = String.Format("hideModal('divApprove');");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgonFinalmodalhide", msgmoda12l, true);
                    }
                    else
                    {
                        //btnRequestAmount.Visible = true;
                        String msg1 = String.Format("alert('C.Total Approval amount is greater than Budget limit,Please request for increase Budget limit.');");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg1, true);
                        String msgmodal = String.Format("showModal('divApprove');");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgonFinalmodal", msgmodal, true);
                    }
                }
            }



            //divApprove.Visible = false;
            return;
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
예제 #25
0
    /// <summary>
    /// Approve PO , open POP-UP "divApprove"
    /// </summary>
    protected void ApprovePO_Onclick(object sender, EventArgs e)
    {
        try
        {
            lblErrorMsg.Text = "";
            decimal maxQuotaed_Amount = 0;
            hdfMaxQuotedAmount.Value = "0";
            hdfOrderAmounts.Value    = "0";

            // check the validity of suppliers

            string  SElectedSupplierToApprove = hdfSupplierBeingApproved.Value;
            string  suppliers     = "";
            string  supplier_code = hdfSupplierBeingApproved.Value;
            decimal Supp_Tot_Amt  = UDFLib.ConvertToDecimal(lbl_TotalAmount.Text);
            suppliers += " select '" + supplier_code + "' union";  //get the ASL_Status_Valid_till date for all supplier

            if (SElectedSupplierToApprove.Contains(supplier_code)) // get the max quotation amount among quoted suppliers and those are under comparison section
            {
                if (Supp_Tot_Amt > maxQuotaed_Amount)
                {
                    maxQuotaed_Amount = Supp_Tot_Amt;
                }
            }

            //approved amount will includes existing POs's amount and current quotation's final amount(based on items selection)
            if (Supp_Tot_Amt > 0)
            {
                hdfOrderAmounts.Value = (UDFLib.ConvertToDecimal(hdfOrderAmounts.Value) + UDFLib.ConvertToDecimal(lbl_TotalAmount.Text)).ToString();
            }


            // }
            hdfMaxQuotedAmount.Value = maxQuotaed_Amount.ToString();
            suppliers += " select '0'";
            DataTable dtSuppDate           = BLL_PURC_Common.Get_Supplier_ValidDate(suppliers);
            string    supplierNameNotValid = "";
            if (dtSuppDate.Rows.Count > 0)
            {
                foreach (DataRow dr in dtSuppDate.Rows)
                {
                    if (Convert.ToDateTime(dr["ASL_Status_Valid_till"]) < DateTime.Now)
                    {
                        if (SElectedSupplierToApprove.Contains(dr["SUPPLIER"].ToString()))// if supplier is in comaparison section
                        {
                            supplierNameNotValid += dr["Full_NAME"].ToString() + ", ";
                        }
                    }
                }
            }

            if (supplierNameNotValid.Length > 0)
            {
                String msg = String.Format("alert('Supplier(s) Expired:  " + supplierNameNotValid + "');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg45", msg, true);
            }
            else
            {
                TechnicalBAL objtechBAL = new TechnicalBAL();

                ViewState["BGTCODE"] = BLL_PURC_Common.Get_BGTCode_Reqsn(Requisitioncode);

                ddlReqsnType.ClearSelection();
                ListItem listreqstype = ddlReqsnType.Items.FindByValue(Convert.ToString(ViewState["SavedReqsnType"]));
                if (listreqstype != null)
                {
                    listreqstype.Selected = true;
                }
                Fill_Budget();
                String msgretv = String.Format("setTimeout(calculate,1000);");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgonFinal", msgretv, true);

                String msgmodal = String.Format("showModal('divApprove');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgonFinalmodal", msgmodal, true);
            }
        }
        catch (Exception ex)
        {
            lblErrorMsg.Text = ex.Message + ex.StackTrace;
            UDFLib.WriteExceptionLog(ex);
        }
    }
예제 #26
0
    //private void BindGridOnRetriveButtonClick(string Querry)
    //{
    //    string[] SupplierList = Querry.Split(',');
    //}
    private void BindGridOnRetriveButtonClick(string Querry)
    {
//        int suppSel = 0;
        string[] arrySuppName       = new string[10];
        string[] arrSuppNameInShort = new string[10];
        string[] SupplierList       = Querry.Split(',');

        //if (rgdItmSpecView.MasterTableView.Columns.Count > 10)
        //{
        //    //Remove all the programatically generated colomn from grid and
        //    for (int i = rgdItmSpecView.MasterTableView.Columns.Count - 1; i >= 10; i--)
        //    {
        //        rgdItmSpecView.MasterTableView.Columns.RemoveAt(i);
        //    }
        //}
        //if (Request.QueryString["Requisitioncode"].ToString().Substring(0, 2) == "ST" || Request.QueryString["Requisitioncode"].ToString().Substring(0, 3) == "OST")
        //{
        //    rgdItmSpecView.MasterTableView.Columns[3].Display = false;
        //}
        StringBuilder strSql    = new StringBuilder();
        StringBuilder strTables = new StringBuilder();

//        decimal MinValues = 0;
//        int col_id = 9;
//        int sel_Id = 0;
        strSql.Append("select distinct a.ITEM_SERIAL_NO,'False' chechstatus, a.QUOTATION_CODE,a.ITEM_REF_CODE, a.ITEM_SHORT_DESC,a.ITEM_FULL_DESC,a.QUOTED_QTY,item.Drawing_Number,Item.Part_Number,item.Unit_and_Packings,M.ROB_Qty,M.REQUESTED_QTY");
        // strTables.Append(" from PMS_Dtl_Quoted_Prices a ");
        strTables.Append("  from PURC_Dtl_Quoted_Prices a inner  join PURC_Lib_Items item On item.Id=A.Item_Ref_Code inner join PURC_Dtl_Supply_Items M on M.item_ref_code=A.item_ref_code and M.Document_Code=a.Document_Code and a.Vessel_Code=M.Vessel_Code   ");
        //foreach (GridDataItem dataItem in rgdSupplierInfo.MasterTableView.Items)
        //{
        for (int i = 0; i < SupplierList.Length - 1; i++)
        {
            string Col_supp = SupplierList[i].ToString();
            strSql.Append(",");
            strTables.Append(" Inner Join ");
            string str = "(select ITEM_REF_CODE,QUOTATION_CODE,isnull(OFFERED_QTY,0) " + Col_supp + "_OFFERED_QTY,isnull((select top 1 Description from PURC_Lib_System_Parameters where Parent_Type='153' and Short_Code=isnull(PURC_Dtl_Quoted_Prices.Item_Type,'ORG')),'') " + Col_supp + "_Item_Type  from PURC_Dtl_Quoted_Prices where supplier_code='" + Col_supp + "' )  " + Col_supp + " on " + Col_supp + ".ITEM_REF_CODE = a.ITEM_REF_CODE and " + Col_supp + ".QUOTATION_CODE=a.QUOTATION_CODE ";
            strTables.Append(str);
            strSql.Append(Col_supp);
            strSql.Append(".* ");

            //GridBoundColumn boundColumn;
            //boundColumn = new GridBoundColumn();
            //boundColumn.HeaderText = Col_supp + " " + "QUOTED_QTY";
            //boundColumn.DataField = Col_supp + "_QUOTED_QTY";
            //boundColumn.UniqueName = Col_supp + "_QUOTED_QTY";
            //boundColumn.DataFormatString = "{0:F2}";
            //boundColumn.MaxLength = 100;
            //boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
            //rgdItmSpecView.MasterTableView.Columns.Add(boundColumn);

            //boundColumn = new GridBoundColumn();
            //boundColumn.HeaderText = Col_supp + " " + "Item_Type";
            //boundColumn.DataField = Col_supp + "_Item_Type";
            //boundColumn.UniqueName = Col_supp + "_Item_Type";
            ////boundColumn.DataFormatString = "{0:F2}";
            //boundColumn.MaxLength = 100;
            //boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
            //rgdItmSpecView.MasterTableView.Columns.Add(boundColumn);
        }
        strSql.Append(" ");
        strSql.Append(strTables);
        //Session["SubQuerry"] = strSql.ToString();
        string sqlstring = Session["SqlString"].ToString();

        string [] queryString = sqlstring.Split(',');
        strSql.Append("where  a.QUOTATION_CODE=(select top 1 QUOTATION_CODE from dbo.PURC_Dtl_Reqsn where REQUISITION_CODE='");
        strSql.Append(queryString[0].ToString());
        strSql.Append("'and Line_type='Q')");
        strSql.Append("and a.Vessel_code ='" + queryString[1].ToString());
        strSql.Append("'and a.Document_code ='" + queryString[2].ToString() + "'");

        TechnicalBAL objtechBAL      = new TechnicalBAL();
        string       FinalQuery      = strSql.ToString();
        DataTable    dtQuatationInfo = objtechBAL.GetTable(FinalQuery);

        rgdItmSpecView.DataSource = dtQuatationInfo;
        rgdItmSpecView.DataBind();
    }
예제 #27
0
    protected void OnStsSaved(object s, EventArgs e)
    {
        try
        {
            TechnicalBAL objTechBAL = new TechnicalBAL();
            TechnicalBAL objpurc    = new TechnicalBAL();

            // reqsncode will be set to "" in uc after update
            string[] prm = HiddenFieldSuppdtRemark.Value.Split(new char[] { ',' });

            DataTable dtQuotations = BLL_PURC_Common.PURC_GET_Quotation_ByReqsnCode(prm[2].ToString());

            DataTable dtQuotationList = new DataTable();
            dtQuotationList.Columns.Add("Qtncode");
            dtQuotationList.Columns.Add("amount");

            foreach (DataRow dr in dtQuotations.Rows)
            {
                if (dr["active_PO"].ToString() == "0") // for those POs have been cancelled(means active_PO is zero)
                {
                    DataRow dtrow = dtQuotationList.NewRow();
                    dtrow[0] = dr["QUOTATION_CODE"].ToString();
                    dtrow[1] = "0";
                    dtQuotationList.Rows.Add(dtrow);
                }
            }
            // save the requested qty into order qty and order qty column on grid will be binded to order qty (change so store the updated qty by supp at the time of eval.) { this functionality has been implemented at rfq send stage}
            // code to update the order qty have been commented ,this is used to save bgt code only.
            //
            //BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase();
            //int retval = 0;
            //if (Session["BudgetDetails"] != null)
            //{
            //    retval = objTechService.Check_Update_BudgetCode(prm[2].ToString(), prm[3].ToString(), ddlBudgetCode.SelectedValue);
            //}
            //else
            //{
            BLL_PURC_Common.Update_OrderQty_From_ReqstQty(prm[2].ToString(), prm[3].ToString(), ddlBudgetCode.SelectedValue);
            //}

            //qtnbased
            int stsEntry = objTechBAL.InsertUserApprovalEntries(prm[2].ToString(), prm[3].ToString(), prm[4].ToString(), Session["userid"].ToString(), ucApprovalUser1.ApproverID, 0, 0, "", ucApprovalUser1.Remark, dtQuotationList);
            if (stsEntry > 0)
            {
                // dtQuotationList is passing but not using in sp ,all quotation will be set as senttosuppdt as true for this reqsn
                int res = objpurc.PURC_Update_SentToSupdt(int.Parse(prm[0]), int.Parse(prm[1]), prm[2].ToString(), int.Parse(Session["USERID"].ToString()), ucApprovalUser1.Remark, dtQuotationList);


                if (res > 0)
                {
                    BLL_PURC_Purchase objPurc = new BLL_PURC_Purchase();
                    //Requisition stage status update and remark
                    objPurc.InsertRequisitionStageStatus(prm[2].ToString(), prm[4].ToString(), prm[3].ToString(), "QEV", " ", Convert.ToInt32(Session["USERID"]), dtQuotationList);
                    BLL_PURC_Common.INS_Remarks(prm[3].ToString(), Convert.ToInt32(Session["userid"].ToString()), ucApprovalUser1.Remark, 302);

                    divOnHold.Visible    = false;
                    divReqStages.Visible = false;

                    ucCustomPagerItems.isCountRecord = 1;
                    BindData();
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
예제 #28
0
    private void ShowSupplierDetails()
    {
        try
        {
            TechnicalBAL objbal = new TechnicalBAL();
            //DataTable dtSupplierData = objbal.GetSupplier_HSEQuestion(Request.QueryString["SupplierCode"].ToString()).Tables[0];
            DataTable dtSupplierData = objbal.GetSupplier_HSEQuestion(Session["SupplierCode"].ToString(), Convert.ToInt16(Request.QueryString["HSEId"].ToString())).Tables[0];

            txtCompanyName.Text        = Convert.ToString(dtSupplierData.Rows[0]["Company_Name"]);
            txtOperations.Text         = Convert.ToString(dtSupplierData.Rows[0]["Company_Operations"]);
            txtAddress.Text            = Convert.ToString(dtSupplierData.Rows[0]["Company_Address"]);
            txtCountry.Text            = Convert.ToString(dtSupplierData.Rows[0]["Company_Country"]);
            txtPhone.Text              = Convert.ToString(dtSupplierData.Rows[0]["Company_Phone"]);
            txtFax.Text                = Convert.ToString(dtSupplierData.Rows[0]["Company_Fax"]);
            txtEmail.Text              = Convert.ToString(dtSupplierData.Rows[0]["Company_Email"]);
            txtWebsiet.Text            = Convert.ToString(dtSupplierData.Rows[0]["Company_WebSite"]);
            txtPIC.Text                = Convert.ToString(dtSupplierData.Rows[0]["Company_PIC"]);
            txtEmergencyContactNo.Text = Convert.ToString(dtSupplierData.Rows[0]["Emergency_Contact_No"]);

            txtSizeTurnover.Text = Convert.ToString(dtSupplierData.Rows[0]["Size_Turnover"]);

            txtAgeOfBusiness.Text            = Convert.ToString(dtSupplierData.Rows[0]["Age_Of_Business"]);
            txtServicesProvided.Text         = Convert.ToString(dtSupplierData.Rows[0]["Services_Provided"]);
            ddlRegulatoryControl.Text        = Convert.ToString(dtSupplierData.Rows[0]["Regulatory_Control"]);
            txtRegulatoryControlRemarks.Text = Convert.ToString(dtSupplierData.Rows[0]["Regulatory_Control_Remarks"]);

            txtCustomer1Name.Text       = Convert.ToString(dtSupplierData.Rows[0]["Customer1_Name"]);
            txtCustomer1Years.Text      = Convert.ToString(dtSupplierData.Rows[0]["Customer1_Years"]);
            txtServiceDescription1.Text = Convert.ToString(dtSupplierData.Rows[0]["Service_Description1"]);
            txtCustomer2Name.Text       = Convert.ToString(dtSupplierData.Rows[0]["Customer2_Name"]);
            txtCustomer2Years.Text      = Convert.ToString(dtSupplierData.Rows[0]["Customer2_Years"]);
            txtServiceDescription2.Text = Convert.ToString(dtSupplierData.Rows[0]["Service_Description2"]);
            txtCustomer3Name.Text       = Convert.ToString(dtSupplierData.Rows[0]["Customer3_Name"]);
            txtCustomer3Years.Text      = Convert.ToString(dtSupplierData.Rows[0]["Customer3_Years"]);
            txtServiceDescription3.Text = Convert.ToString(dtSupplierData.Rows[0]["Service_Description3"]);

            txtHoursWorkedYTD.Text  = Convert.ToString(dtSupplierData.Rows[0]["Hours_Worked_YTD"]);
            txtHoursWorked2Yrs.Text = Convert.ToString(dtSupplierData.Rows[0]["Hours_Worked_2Yrs"]);

            txtFatalInjuriesYTD.Text  = Convert.ToString(dtSupplierData.Rows[0]["Fatal_injuries_YTD"]);
            txtFatalInjuries2Yrs.Text = Convert.ToString(dtSupplierData.Rows[0]["Fatal_Injuries_2Yrs"]);

            txtLostDayInjuriesYTD.Text                = Convert.ToString(dtSupplierData.Rows[0]["LostDay_Injuries_YTD"]);
            txtLostDayInjuries2Yrs.Text               = Convert.ToString(dtSupplierData.Rows[0]["LostDay_Injuries_2Yrs"]);
            txtIncidenceRateYTD.Text                  = Convert.ToString(dtSupplierData.Rows[0]["Incidence_Rate_YTD"]);
            txtIncidenceRate2Yrs.Text                 = Convert.ToString(dtSupplierData.Rows[0]["Incidence_Rate_2Yrs"]);
            txtGovernmentInsp3Yrs.Text                = Convert.ToString(dtSupplierData.Rows[0]["Government_Insp_3Yrs"]);
            txtSignificantIncidents3Yrs.Text          = Convert.ToString(dtSupplierData.Rows[0]["Significant_Incidents_3Yrs"]);
            ddlInsuranceIndemity.Text                 = Convert.ToString(dtSupplierData.Rows[0]["Insurance_Indemity"]);
            txtInsuranceIndemityRemarks.Text          = Convert.ToString(dtSupplierData.Rows[0]["Insurance_Indemity_Remarks"]);
            ddlQualityAssurance.Text                  = Convert.ToString(dtSupplierData.Rows[0]["Quality_Assurance"]);
            txtQualityAssuranceRemarks.Text           = Convert.ToString(dtSupplierData.Rows[0]["Quality_Assurance_Remarks"]);
            ddlTrainingNewEmployees.Text              = Convert.ToString(dtSupplierData.Rows[0]["Training_New_Employees"]);
            txtTrainingNewEmployeesRemarks.Text       = Convert.ToString(dtSupplierData.Rows[0]["Training_New_Employees_Remarks"]);
            ddlTrainingExisitingEmployees.Text        = Convert.ToString(dtSupplierData.Rows[0]["Training_Exisiting_Employees"]);
            txtTrainingExisitingEmployeesRemarks.Text = Convert.ToString(dtSupplierData.Rows[0]["Training_Exisiting_Employees_Remarks"]);
            txtClientList.Text               = Convert.ToString(dtSupplierData.Rows[0]["Client_List"]);
            ddlIncidentReporting.Text        = Convert.ToString(dtSupplierData.Rows[0]["Incident_Reporting"]);
            txtIncidentReportingRemarks.Text = Convert.ToString(dtSupplierData.Rows[0]["Incident_Reporting_Remarks"]);
            ddlNearMissReporting.Text        = Convert.ToString(dtSupplierData.Rows[0]["Near_Miss_Reporting"]);
            txtNearMissReportingRemarks.Text = Convert.ToString(dtSupplierData.Rows[0]["Near_Miss_Reporting_Remarks"]);
            ddlSafetyEquipment.Text          = Convert.ToString(dtSupplierData.Rows[0]["Safety_Equipment"]);
            txtSafetyEquipmentRemarks.Text   = Convert.ToString(dtSupplierData.Rows[0]["Safety_Equipment_Remarks"]);

            ddlEmployeeEquipTraining.Text         = Convert.ToString(dtSupplierData.Rows[0]["Employee_Equip_Training"]);
            txtEmployeeEquipTrainingRemarks.Text  = Convert.ToString(dtSupplierData.Rows[0]["Employee_Equip_Training_Remarks"]);
            ddlContractorEquipTraining.Text       = Convert.ToString(dtSupplierData.Rows[0]["Contractor_Equip_Training"]);
            txtContractorEquipTrainingRemark.Text = Convert.ToString(dtSupplierData.Rows[0]["Contractor_Equip_Training_Remarks"]);

            ddlCleanWorkingEnvironment.Text        = Convert.ToString(dtSupplierData.Rows[0]["Clean_Working_Environment"]);
            txtCleanWorkingEnvironmentRemarks.Text = Convert.ToString(dtSupplierData.Rows[0]["Clean_Working_Environment_Remarks"]);
            ddlEquipmentCalibration.Text           = Convert.ToString(dtSupplierData.Rows[0]["Equipment_Calibration"]);
            txtEquipmentCalibrationRemarks.Text    = Convert.ToString(dtSupplierData.Rows[0]["Equipment_Calibration_Remarks"]);

            ddlCalibrationCertificates.Text        = Convert.ToString(dtSupplierData.Rows[0]["Calibration_Certificates"]);
            txtCalibrationCertificatesRemarks.Text = Convert.ToString(dtSupplierData.Rows[0]["Calibration_Certificates_Remarks"]);

            ddlClientFamiliarizationvisits.Text        = Convert.ToString(dtSupplierData.Rows[0]["Client_Familiarization_visits"]);
            txtClientFamiliarizationVisitsRemarks.Text = Convert.ToString(dtSupplierData.Rows[0]["Calibration_Certificates_Remarks"]);

            ddlMeetStandardRequirements.Text        = Convert.ToString(dtSupplierData.Rows[0]["Meet_Standard_Requirements"]);
            txtMeetStandardRequirementsRemarks.Text = Convert.ToString(dtSupplierData.Rows[0]["Meet_Standard_Requirements_Remarks"]);
            txtHSEQSubmittedDate.Text          = Convert.ToDateTime(dtSupplierData.Rows[0]["HSEQ_Submitted_Date"]).ToString("dd-MM-yyyy");
            txtHSEQSubmittedBy.Text            = Convert.ToString(dtSupplierData.Rows[0]["HSEQ_Submitted_By"]);
            ddlESMCompetitiveQuote.Text        = Convert.ToString(dtSupplierData.Rows[0]["ESM_Competitive_Quote"]);
            txtESMCompetitiveQuoteRemarks.Text = Convert.ToString(dtSupplierData.Rows[0]["ESM_Competitive_Quote_Remarks"]);
            ddlESMQuickResponsee.Text          = Convert.ToString(dtSupplierData.Rows[0]["ESM_Quick_Response"]);
            txtESMQuickResponseRemarks.Text    = Convert.ToString(dtSupplierData.Rows[0]["ESM_Quick_Response_Remarks"]);
            ddlESMOntimeDelivery.Text          = Convert.ToString(dtSupplierData.Rows[0]["ESM_Ontime_Delivery"]);
            txtESMOntimeDeliveryRemarks.Text   = Convert.ToString(dtSupplierData.Rows[0]["ESM_Ontime_Delivery_Remarks"]);
            ddlESMPromptAdvice.Text            = Convert.ToString(dtSupplierData.Rows[0]["ESM_Prompt_Advice"]);
            txtESMPromptAdviceRemarks.Text     = Convert.ToString(dtSupplierData.Rows[0]["ESM_Prompt_Advice_Remarks"]);
            lblDateOfCreation.Text             = Convert.ToDateTime(dtSupplierData.Rows[0]["Date_Of_Creatation"]).ToString("dd-MMM-yyyy");
        }
        catch (Exception ex)
        {
            //.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex);
        }
    }
예제 #29
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            StringBuilder strQuery   = new StringBuilder();
            TechnicalBAL  objTechBAL = new TechnicalBAL();
            VsDtOrder = (DataTable)ViewState["VsDtOrder"];
            int     i = 0;
            string  strReqCode = VsDtOrder.Rows[0]["Requisition"].ToString();
            string  strDocCode = VsDtOrder.Rows[0]["DOCUMENT_CODE"].ToString();
            string  strSuppCode = VsDtOrder.Rows[0]["QUOTATION_SUPPLIER"].ToString();
            string  strOrderCode = VsDtOrder.Rows[0]["ORDER_CODE"].ToString();
            string  strVesselCode = VsDtOrder.Rows[0]["Vessel_Code"].ToString();
            string  strCreatedBy = Session["userid"].ToString();
            string  strPayAt = "On Office";
            decimal dclSuppOrdDiscount = Convert.ToDecimal(VsDtOrder.Rows[0]["suppOrderDiscount"].ToString());
            decimal dclTotalPay = 0, dclRoundOffAmt = 0;

            if (txtAmount.Text.Trim() != "")
            {
                dclTotalPay = Convert.ToDecimal(txtAmount.Text.Trim().ToString());
            }
            else
            {
                dclTotalPay = 0;
            }

            if (txtRoundoff.Text.Trim() != "")
            {
                dclRoundOffAmt = Convert.ToDecimal(txtRoundoff.Text.Trim().ToString());
            }
            else
            {
                dclRoundOffAmt = 0;
            }

            string strSystemCode = VsDtOrder.Rows[0]["ITEM_SYSTEM_CODE"].ToString();
            string strDeptCode = VsDtOrder.Rows[0]["DEPARTMENT"].ToString();
            string strDeliverQty = "", strUpdateROBQty = "", strItemIDs = "";

            foreach (GridDataItem dataItem in rgdDeliveredItems.MasterTableView.Items)
            {
                TextBox txtDeliverdQty = (TextBox)(dataItem.FindControl("txtDeliverdQty") as TextBox);
                Label   txtUpdateROB   = (Label)(dataItem.FindControl("txtUpdateROB") as Label);

                if (txtDeliverdQty.Text.Trim() != "")
                {
                    strDeliverQty   = strDeliverQty + txtDeliverdQty.Text.ToString() + ",";
                    strUpdateROBQty = strUpdateROBQty + txtUpdateROB.Text.ToString() + ",";

                    strItemIDs = strItemIDs + dataItem["ITEM_REF_CODE"].Text.ToString() + ",";

                    i++;
                }
            }

            if (i == 0)
            {
                String msgNoItem = String.Format("alert('Please enter quantity for deliver.')");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgNoItem", msgNoItem, true);
                lblError.Text = "Please enter quantity for deliver.";
            }
            else
            {
                int RetValue = objTechBAL.UpdateDelivery(strReqCode, strDocCode, strSuppCode, strOrderCode,
                                                         strVesselCode, strCreatedBy, strPayAt, dclTotalPay,
                                                         dclRoundOffAmt, strSystemCode, strDeptCode, strItemIDs,
                                                         strDeliverQty, strUpdateROBQty, dclSuppOrdDiscount
                                                         );

                DataTable dtDeliverItem = (DataTable)ViewState["dtDeliverItem"];

                foreach (DataRow dr in dtDeliverItem.Rows)
                {
                    if (dr["ITEM_REF_CODE"].ToString() == "")
                    {
                        strQuery.Append("Insert into [PURC_Dtl_Supply_Items]([ID],ITEM_SYSTEM_CODE,[DOCUMENT_CODE],[ITEM_SERIAL_NO],[REQUISITION_CODE],");
                        strQuery.Append("[ORDER_CODE],[Order_Date],[REQUESTED_QTY],[ITEM_SHORT_DESC],[ORDER_QTY],[ORDER_SUPPLIER],[Vessel_Code],[Created_By],");
                        strQuery.Append("[Date_Of_Creatation],DELIVERY_CODE,ORDER_PRICE,ORDER_RATE,DELIVERD_QTY,Item_delivery_Remarks )");
                        strQuery.Append("(select  Top 1 (select max([ID])+1 from [PURC_Dtl_Supply_Items]),ITEM_SYSTEM_CODE,[DOCUMENT_CODE],0,[REQUISITION_CODE],");
                        strQuery.Append("[ORDER_CODE],[Order_Date],1,'");
                        strQuery.Append(dr["Short_Description"].ToString());
                        strQuery.Append("',1,[ORDER_SUPPLIER],[Vessel_Code],[Created_By],[Date_Of_Creatation],DELIVERY_CODE,'");
                        strQuery.Append(dr["Rate"].ToString());
                        strQuery.Append("','");
                        strQuery.Append(dr["Rate"].ToString());
                        strQuery.Append("','1','" + Convert.ToString(dr["Item_delivery_Remarks"]) + "from [PURC_Dtl_Supply_Items]");
                        strQuery.Append(" where [REQUISITION_CODE]= '");
                        strQuery.Append(strReqCode);
                        strQuery.Append("' and ORDER_CODE='");
                        strQuery.Append(strOrderCode);
                        strQuery.Append("')  ");
                    }
                }

                int val = objTechBAL.ExecuteQuery(strQuery.ToString());

                String msg = String.Format("alert('Delivered Items has been save successfully.')");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
                lblError.Text = "Delivered Items has been save successfully.";

                //cmbRequisitionList.SelectedIndex = 0;
                FillReq_Catalog();
                BindOrderItem();
                RefreshGrid();

                using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
                {
                    //Update the requistion Stage Status
                    DataTable dtQuotationList = new DataTable();
                    dtQuotationList.Columns.Add("Qtncode");
                    dtQuotationList.Columns.Add("amount");

                    objTechService.InsertRequisitionStageStatus(Request.QueryString["Requisitioncode"].ToString(), Request.QueryString["Vessel_Code"].ToString(), Request.QueryString["Document_Code"].ToString(), "DLV", " ", Convert.ToInt32(Session["userid"]), dtQuotationList);
                }
            }
        }
        catch (Exception ex)
        {
            //.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex);
        }
    }
예제 #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string         pathrptPO = Server.MapPath(".");
        DataSet        dsrpt;
        DataSet        dsReqSumm;
        ReportDocument objrptPO = new ReportDocument();
        TechnicalBAL   objbal   = new TechnicalBAL();

        //  Session["sType"]
        string Selection = Session["sType"].ToString();

        string strRptPath = Server.MapPath(".");

        switch (Selection)
        {
        case "NRQ":
            using (BLL_PURC_Purchase objTechService = new  BLL_PURC_Purchase())
            {
                dsrpt = objTechService.GetReqItemsPreview(Request.QueryString["Requisitioncode"].ToString(), Request.QueryString["Vessel_Code"].ToString(), Request.QueryString["Document_Code"].ToString());
            }
            ConnectionInfo cInfo2        = new ConnectionInfo();
            TableLogOnInfo logOnInfo2    = new TableLogOnInfo();
            string         connstring    = System.Configuration.ConfigurationManager.ConnectionStrings["smsconn"].ToString();
            string[]       conn2         = connstring.ToString().Split(';');
            string[]       serverInfo2   = conn2[0].ToString().Split('=');
            string[]       DbInfo2       = conn2[1].ToString().Split('=');
            string[]       userInfo2     = conn2[2].ToString().Split('=');
            string[]       passwordInfo2 = conn2[3].ToString().Split('=');

            cInfo2.ServerName   = serverInfo2[1].ToString();
            cInfo2.DatabaseName = DbInfo2[1].ToString();
            cInfo2.UserID       = userInfo2[1].ToString();
            cInfo2.Password     = passwordInfo2[1].ToString();

            CrystalReportsFile.RequisitionItemsPreview ReqItmPreview = new CrystalReportsFile.RequisitionItemsPreview();

            foreach (CrystalDecisions.CrystalReports.Engine.Table reportTable in ReqItmPreview.Database.Tables)
            {
                logOnInfo2 = reportTable.LogOnInfo;
                logOnInfo2.ConnectionInfo = cInfo2;
                reportTable.ApplyLogOnInfo(logOnInfo2);
            }
            ReqItmPreview.SetDataSource(dsrpt.Tables[0]);
            CrystalReportViewerPOAPR.ReportSource   = ReqItmPreview;
            CrystalReportViewerPOAPR.DisplayToolbar = true;
            break;

        case "PFA":
            dsrpt = objbal.GetPMS_Report_POApproval(Session["sVesselCode"].ToString(), Session["sDeptCode"].ToString());

            ConnectionInfo cInfo     = new ConnectionInfo();
            TableLogOnInfo logOnInfo = new TableLogOnInfo();
            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();


            CrystalReports.REQDeliveryStatus objREQDeliveryStatus = new CrystalReports.REQDeliveryStatus();

            foreach (CrystalDecisions.CrystalReports.Engine.Table reportTable in objREQDeliveryStatus.Database.Tables)
            {
                logOnInfo = reportTable.LogOnInfo;
                logOnInfo.ConnectionInfo = cInfo;
                reportTable.ApplyLogOnInfo(logOnInfo);
            }
            objREQDeliveryStatus.SetDataSource(dsrpt.Tables[0]);
            CrystalReportViewerPOAPR.ReportSource   = objREQDeliveryStatus;
            CrystalReportViewerPOAPR.DisplayToolbar = true;
            break;

        case "DVS":
            dsrpt = objbal.GetPMS_Report_DeliveryStatus(Session["sVesselCode"].ToString(), Session["sDeptCode"].ToString());


            ConnectionInfo cInfo1        = new ConnectionInfo();
            TableLogOnInfo logOnInfo1    = new TableLogOnInfo();
            string         connstring1   = System.Configuration.ConfigurationManager.ConnectionStrings["smsconn"].ToString();
            string[]       conn1         = connstring1.ToString().Split(';');
            string[]       serverInfo1   = conn1[0].ToString().Split('=');
            string[]       DbInfo1       = conn1[1].ToString().Split('=');
            string[]       userInfo1     = conn1[2].ToString().Split('=');
            string[]       passwordInfo1 = conn1[3].ToString().Split('=');

            cInfo1.ServerName   = serverInfo1[1].ToString();
            cInfo1.DatabaseName = DbInfo1[1].ToString();
            cInfo1.UserID       = userInfo1[1].ToString();
            cInfo1.Password     = passwordInfo1[1].ToString();

            CrystalReports.POApproval objPOApproval = new CrystalReports.POApproval();

            foreach (CrystalDecisions.CrystalReports.Engine.Table reportTable in objPOApproval.Database.Tables)
            {
                logOnInfo1 = reportTable.LogOnInfo;
                logOnInfo1.ConnectionInfo = cInfo1;
                reportTable.ApplyLogOnInfo(logOnInfo1);
            }
            objPOApproval.SetDataSource(dsrpt.Tables[0]);
            CrystalReportViewerPOAPR.ReportSource   = objPOApproval;
            CrystalReportViewerPOAPR.DisplayToolbar = true;

            //objrptPO.Load(pathrptPO + @"\REQDeliveryStatus.rpt");
            //objrptPO.SetDataSource(dsrpt);
            //CrystalReportViewerPOAPR.ReportSource = objrptPO;
            //CrystalReportViewerPOAPR.DataBind();
            break;

        case "ARQ":

            objbal    = new TechnicalBAL();
            dsReqSumm = new DataSet();
            dsReqSumm = objbal.GetReqsnOrderApprovalSummary(Request.QueryString["Requisitioncode"].ToString(), Request.QueryString["Document_Code"].ToString(), Request.QueryString["Vessel_Code"].ToString(), Request.QueryString["ORDER_CODE"].ToString(), Request.QueryString["ORDER_SUPPLIER"].ToString());
            ReportDocument rptSumryDoc = new ReportDocument();
            rptSumryDoc.Load(strRptPath + "\\RptRequisitionApproval.rpt");
            rptSumryDoc.SetDataSource(dsReqSumm.Tables[0]);
            CrystalReportViewerPOAPR.ReportSource = rptSumryDoc;

            CrystalReportViewerPOAPR.DisplayToolbar = true;

            break;
        }
    }