protected void BindItems()
    {
        if (!isCallFromPageLoad)
        {
            SaveItems();
        }

        #region ===================== Merge header columns ============================
        DataTable dtqtn = (DataTable)ViewState["dtqtns"];

        if (objItemColumn.MergedColumns.Count == 0)
        {
            int    columnindex  = lastFixedColumnID + 1;
            int    groupid      = 1;
            string GroupCss     = "";
            string suppliername = "";
            string portname     = "";
            foreach (GridViewRow gr in rgdSupplierInfo.Rows)
            {
                DataRow drqtnid = dtqtn.Rows.Find(rgdSupplierInfo.DataKeys[gr.RowIndex].Values["Quotation_ID"].ToString());
                //get show only quoted item status for filter

                drqtnid["onlyQuoted"]    = ((CheckBox)gr.FindControl("chkshowOnlyQuoted")).Checked == true ? "1" : "0";
                drqtnid["ApprvalStatus"] = ((DropDownList)gr.FindControl("ddlApproval")).SelectedValue == "" ? null : ((DropDownList)gr.FindControl("ddlApproval")).SelectedValue;

                dicchkOnlyQuoted.Add(gr.RowIndex, ((CheckBox)gr.FindControl("chkshowOnlyQuoted")).Checked);

                dicddlApproval.Add(gr.RowIndex, ((DropDownList)gr.FindControl("ddlApproval")).SelectedValue);

                if (groupid % 2 == 1)
                {
                    GroupCss = "Ctp-QtnEval-HeaderStyle-css";
                }
                else
                {
                    GroupCss = "Ctp-QtnEval-AltHeaderStyle-css";
                }

                suppliername = ((Label)gr.FindControl("lblSupplierName")).Text;
                suppliername = suppliername.Length > 20 ? suppliername.Substring(0, 19) : suppliername;
                portname     = ((Label)gr.FindControl("lblPortName")).Text;
                portname     = portname.Length > 20 ? portname.Substring(0, 19) : portname;

                objItemColumn.AddMergedColumns(new int[] { columnindex, columnindex + 1, columnindex + 2, columnindex + 3, columnindex + 4, columnindex + 5, columnindex + 6 }, suppliername + "&nbsp ,&nbsp " + portname, GroupCss);


                columnindex += SupplierColumnGroup;
                groupid++;
            }

            dtqtn.AcceptChanges();
        }

        #endregion


        int is_fetch_count = ucCustomPageritems.isCountRecord;

        rgdQuatationInfo.DataSource = BLL_PURC_CTP.Get_Ctp_Qtn_Eval_Item(dtqtn,
                                                                         UDFLib.ConvertStringToNull(txtitemsearch.Text),
                                                                         UDFLib.ConvertStringToNull(ddlSubCatalogue.SelectedValue),
                                                                         UDFLib.ConvertIntegerToNull(""),
                                                                         ucCustomPageritems.CurrentPageIndex,
                                                                         ucCustomPageritems.PageSize,
                                                                         ref is_fetch_count,
                                                                         UDFLib.ConvertIntegerToNull(ViewState["SortDirection"]),
                                                                         UDFLib.ConvertStringToNull(ViewState["SortColumn"]));

        rgdQuatationInfo.DataBind();

        if (ucCustomPageritems.isCountRecord == 1)
        {
            ucCustomPageritems.CountTotalRec = is_fetch_count.ToString();
            ucCustomPageritems.BuildPager();
        }

        isCallFromPageLoad = false;
    }
Exemplo n.º 2
0
    public void BindData_UnSelected()
    {
        int IsFetchCount = ucCustomPagerItem_UnSelected.isCountRecord;

        gvItem_UnSelected.DataSource = BLL_PURC_CTP.Get_Ctp_Items(Catalogue_code, UDFLib.ConvertStringToNull(SubCatalogue), UDFLib.ConvertStringToNull(txtItemSearch.Text), (DataTable)ViewState["vsdtSelected_Items"], (DataTable)ViewState["vsdtSelected_SubCatalogue"], (DataTable)ViewState["vsdtSelected_SubCatalogue_items"], 0,
                                                                  UDFLib.ConvertIntegerToNull(Quotation_ID), ucCustomPagerItem_UnSelected.CurrentPageIndex, ucCustomPagerItem_UnSelected.PageSize, ref IsFetchCount, Contract_ID);
        gvItem_UnSelected.DataBind();

        if (ucCustomPagerItem_UnSelected.isCountRecord == 1)
        {
            ucCustomPagerItem_UnSelected.CountTotalRec = IsFetchCount.ToString();
            ucCustomPagerItem_UnSelected.BuildPager();
        }


        btnSelect_All.Enabled             = (IsFetchCount < 1) ? false : true;
        btnselectAll_SubCatalogue.Enabled = (IsFetchCount < 1 || SubCatalogue.Trim() == "" || SubCatalogue.Trim() == "0") ? false : true;

        Set_SelectedCatalogue();
    }
Exemplo n.º 3
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        int retval;

        if (HiddenFlag.Value == "Add")
        {
            retval = objBLLSysVariable.Insert_SysVariable(UDFLib.ConvertStringToNull(ddlVariableType.SelectedValue), txtName.Text.Trim()
                                                          , txtCode.Text.Trim(), txtValue.Text.Trim(), txtColorCode.Text.Trim(), Convert.ToInt32(Session["USERID"]));
        }
        else
        {
            retval = objBLLSysVariable.Edit_SysVariable(UDFLib.ConvertIntegerToNull(txtVariableID.Text), UDFLib.ConvertStringToNull(ddlVariableType.SelectedValue), txtName.Text.Trim()
                                                        , txtCode.Text.Trim(), txtValue.Text.Trim(), txtColorCode.Text.Trim(), Convert.ToInt32(Session["USERID"]));
        }
        if (retval >= 1)
        {
            BindSysVariableGrid();
            string hidemodal = String.Format("hideModal('divadd')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
        else
        {
            lblMsg.Text = "Variable Code already exists.";
        }
    }
Exemplo n.º 4
0
    public void BindData()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;
        BLL_PURC_Purchase objPurcBLL    = new BLL_PURC_Purchase();
        string            sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        string            sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = (ViewState["SORTDIRECTION"].ToString());
        }

        //DataTable dt = objPurcBLL.SelectNewRequisitionList((DataTable)Session["sFleet"], (DataTable)Session["sVesselCode"]
        //                        , UDFLib.ConvertStringToNull(Session["sDeptType"]), (DataTable)Session["sDeptCode"]
        //                        , UDFLib.ConvertIntegerToNull(Session["ReqsnType"].ToString()), UDFLib.ConvertStringToNull(Session["REQNUM"].ToString())
        //                        , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref  rowcount,sortbycoloumn, UDFLib.ConvertStringToNull(sortdirection));

        DataTable dt = objPurcBLL.SelectNewRequisitionList_New
                           (UDFLib.ConvertStringToNull(Session["sFleet"]), UDFLib.ConvertStringToNull(Session["sVesselCode"])
                           , UDFLib.ConvertStringToNull(Session["sDeptType"])
                           , UDFLib.ConvertStringToNull(Session["sPurc_Dept"])
                           , UDFLib.ConvertStringToNull(Session["REQNUM"])
                           , UDFLib.ConvertStringToNull(Session["sPOType"])
                           , UDFLib.ConvertStringToNull(Session["sAccType"])
                           , UDFLib.ConvertStringToNull(Session["ReqsnType"])
                           , UDFLib.ConvertStringToNull(Session["sCatalogue"])
                           , UDFLib.ConvertDateToNull(Session["sFrom"])
                           , UDFLib.ConvertDateToNull(Session["sTO"])
                           , UDFLib.ConvertStringToNull(Session["sAccClass"])
                           , UDFLib.ConvertStringToNull(Session["sUrgency"])
                           , UDFLib.ConvertStringToNull((Session["sReqsnStatus"]))
                           , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount, sortbycoloumn, UDFLib.ConvertStringToNull(sortdirection));

        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }

        rgdNewREQ.DataSource = dt;

        if (ViewState["NeedDataSource"] == "0")
        {
            rgdNewREQ.DataBind();
        }


        string script = " var height = document.body.scrollHeight;parent.ResizeFromChild(height,'1');";

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "resize" + DateTime.Now.Millisecond.ToString(), script, true);
    }
Exemplo n.º 5
0
    protected void lbtnDAEdit_Click(object s, CommandEventArgs e)
    {
        string[] arg   = e.CommandArgument.ToString().Split(',');
        int?     DA_ID = UDFLib.ConvertIntegerToNull(arg[0]);

        ViewState["DA_ID"]      = UDFLib.ConvertIntegerToNull(arg[0]);
        ViewState["Agent_Code"] = UDFLib.ConvertIntegerToNull(arg[1]);
        DataSet ds = objPortCall.Get_PortCall_DAItem(UDFLib.ConvertStringToNull(ViewState["DA_ID"]), UDFLib.ConvertStringToNull(ViewState["Agent_Code"]), UDFLib.ConvertStringToNull(ddlPortCost.SelectedValue));

        if (ds.Tables[0].Rows.Count > 0)
        {
            gvDAItem.DataSource = ds;
            gvDAItem.DataBind();
        }

        //BindActivity();
    }
Exemplo n.º 6
0
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        int    rowcount      = ucCustomPagerItems.isCountRecord;
        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }

        DataSet ds = objJobStatus.TecJobOverDueSearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), ucf_DDLVessel.SelectedValues, ucf_DLLLocation.SelectedValues, ucf_DDLSubCatalogue.SelectedValues
                                                      , UDFLib.ConvertIntegerToNull(DDLJobDepartment.SelectedValue), ucf_DDLRank.SelectedValues, UDFLib.ConvertStringToNull(ucf_txtSearchJobTitle.FilterText), ucf_txtSearchJobTitle.FilterType
                                                      , UDFLib.ConvertIntegerToNull(ucf_txtSearchJobID.FilterNumber), ucf_txtSearchJobID.FilterType, ucf_optCritical.SelectedValues, ucf_optCMS.SelectedValues, null, null
                                                      , UDFLib.ConvertIntegerToNull(ddlMonth.SelectedValue), UDFLib.ConvertIntegerToNull(ddlYear.SelectedValue), UDFLib.ConvertStringToNull(optStatus.SelectedValue)
                                                      , sortbycoloumn, sortdirection, null, null, ref rowcount);

        string[] HeaderCaptions  = { "Vessel", "Location", "SubSystem", "Job Code", "Job Title", "Frequency", "Frequency Name", "Last Done", "Rhrs", "Next Due", "CMS", "Critical", "Tentative Completion Date", "Modified Completion Date", "Responded By" };
        string[] DataColumnsName = { "Vessel_Name", "Location", "SubSystem", "JOB_ID", "JOB_TITLE", "FREQUENCY", "Frequency_Name", "LAST_DONE", "RHRS_DONE", "DATE_NEXT_DUE", "CMS", "Critical", "Tentative_Completion_Date", "Modified_Completion_Date", "Actioned_By" };

        GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "PMS Overdue Jobs", "PMS Overdue Jobs", "");
    }
    protected int InvoiceUpload(string FileStatus, string Action_On_Data_Form)
    {
        int ret = 0;

        try
        {
            if (FileUploader.HasFile)
            {
                if (FileUploader.FileName != "")
                {
                    string strLocalPath  = FileUploader.PostedFile.FileName;
                    string FileName      = Path.GetFileName(strLocalPath);
                    string FileExtension = Path.GetExtension(strLocalPath);
                    int    TYPE          = 0;
                    string InvoiceType   = "CREDIT";
                    Guid   FileGuid      = System.Guid.NewGuid();

                    FileUploader.PostedFile.SaveAs(Server.MapPath(@"~/Uploads\\ASL\\Invoice\\" + FileGuid + FileExtension));

                    ret = BLL_ASL_Supplier.Supplier_Upload_Document_Insert(UDFLib.ConvertIntegerToNull(txtFileID.Text.Trim()), UDFLib.ConvertStringToNull(GetSupplierCode()), UDFLib.ConvertStringToNull(GetSuppID()), FileName, FileGuid + FileExtension, FileExtension
                                                                           , txtInvioceRef.Text.Trim(), UDFLib.ConvertDateToNull(txtInvoiceDate.Text), UDFLib.ConvertDecimalToNull(txtInvoiceAmount.Text), UDFLib.ConvertDecimalToNull(txtTaxAmount.Text), txtRemarks.Text.Trim(),
                                                                           UDFLib.ConvertDateToNull(txtDueDate.Text), FileStatus, Action_On_Data_Form, InvoiceType, UDFLib.ConvertIntegerToNull(Session["userid"]), TYPE);
                }
            }
            else if (lblFileName.Text != "")
            {
                string FileName      = "";
                string FileExtension = "";
                int    TYPE          = 0;
                string InvoiceType   = "CREDIT";
                Guid   FileGuid      = System.Guid.NewGuid();
                ret = BLL_ASL_Supplier.Supplier_Upload_Document_Insert(UDFLib.ConvertIntegerToNull(txtFileID.Text.Trim()), UDFLib.ConvertStringToNull(GetSupplierCode()), UDFLib.ConvertStringToNull(GetSuppID()), FileName, "", FileExtension
                                                                       , txtInvioceRef.Text.Trim(), UDFLib.ConvertDateToNull(txtInvoiceDate.Text), UDFLib.ConvertDecimalToNull(txtInvoiceAmount.Text), UDFLib.ConvertDecimalToNull(txtTaxAmount.Text), txtRemarks.Text.Trim(),
                                                                       UDFLib.ConvertDateToNull(txtDueDate.Text), FileStatus, Action_On_Data_Form, InvoiceType, UDFLib.ConvertIntegerToNull(Session["userid"]), TYPE);
            }
            return(ret);
        }

        catch { return(ret); }
        {
        }
    }
    public void BindPaymentSchedule()
    {
        try
        {
            DataSet ds = BLL_POLOG_Register.POLOG_Get_Payment_Schedule_Amount(UDFLib.ConvertStringToNull(ddlSupplier.SelectedValue),
                                                                              UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertStringToNull(ddlOwner.SelectedValue), chkUrgent.Checked ? 1 : 0, UDFLib.ConvertIntegerToNull(GetSessionUserID()));

            if (ds.Tables[0].Rows.Count > 0)
            {
                table1.Visible = true;
                gvPaymentApproved.DataSource = ds.Tables[0];
                gvPaymentApproved.DataBind();
                gvPaymentSchedule.DataSource = ds.Tables[1];
                gvPaymentSchedule.DataBind();
            }
            else
            {
                table1.Visible = false;
                gvPaymentApproved.DataSource = ds.Tables[0];
                gvPaymentApproved.DataBind();
                gvPaymentSchedule.DataSource = ds.Tables[1];
                gvPaymentSchedule.DataBind();
            }
        }
        catch { }
        {
        }
    }
    protected void BindPaymentApprovedGrid()
    {
        try
        {
            int rowcount = ucCustomPager2.isCountRecord;
            objChangeReqstMerge.AddMergedColumns(new int[] { 2, 3, 4 }, "PO", "HeaderStyle-center");
            //objChangeReqstMerge.AddMergedColumns(new int[] { 5, 6 }, "Total Invoice Value & Count", "HeaderStyle-center");
            objChangeReqstMerge.AddMergedColumns(new int[] { 5, 6, 7, 8, 9, 10, 11, 12, 13 }, "Invoice", "HeaderStyle-center");
            objChangeReqstMerge.AddMergedColumns(new int[] { 14, 15 }, "Payment Approved", "HeaderStyle-center");

            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }
            string InvoiceAmt    = (ViewState["InvoiceAmt"] == null) ? null : (ViewState["InvoiceAmt"].ToString());
            string InvoiceStatus = (ViewState["InvoiceStatus"] == null) ? null : (ViewState["InvoiceStatus"].ToString());
            string PaymentStatus = (ViewState["PaymentStatus"] == null) ? null : (ViewState["PaymentStatus"].ToString());

            DataTable dt = BLL_POLOG_Register.POLOG_Get_Approved_Payment_Invoice_Search(UDFLib.ConvertStringToNull(ddlSupplier.SelectedValue),
                                                                                        UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertStringToNull(ddlOwner.SelectedValue), chkUrgent.Checked ? 1 : 0, InvoiceStatus, PaymentStatus, UDFLib.ConvertIntegerToNull(GetSessionUserID()), sortbycoloumn, sortdirection
                                                                                        , ucCustomPager2.CurrentPageIndex, ucCustomPager2.PageSize, ref rowcount);


            if (ucCustomPager2.isCountRecord == 1)
            {
                ucCustomPager2.CountTotalRec = rowcount.ToString();
                ucCustomPager2.BuildPager();
            }
            if (dt.Rows.Count > 0)
            {
                btnUnApprove.Visible         = true;
                divApprovedPayment.Visible   = true;
                gvApprovedPayment.DataSource = dt;
                gvApprovedPayment.DataBind();
            }
            else
            {
                divApprovedPayment.Visible   = false;
                btnUnApprove.Visible         = false;
                gvApprovedPayment.DataSource = dt;
                gvApprovedPayment.DataBind();
            }
        }
        catch { }
        {
        }
    }
Exemplo n.º 10
0
    protected void DetailsView_NewAcc_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        if (e.Values["Beneficiary"] == null || e.Values["Acc_NO"] == null || e.Values["Bank_Name"] == null || e.Values["Bank_Address"] == null || e.Values["SwiftCode"] == null)
        {
            string js = "parent.ShowNotification('Alert','Unable to save as some of the fields are left blank',true)";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js, true);
            if (((CheckBox)DetailsView_NewAcc.FindControl("chkMOAcc")).Checked == true)
            {
                DisableControls();
            }
        }
        else
        {
            int    AccID        = UDFLib.ConvertToInteger(HiddenField_AccID.Value);
            int    CrewID       = UDFLib.ConvertToInteger(HiddenField_CrewID.Value);
            string Beneficiary  = e.Values["Beneficiary"].ToString();
            string Acc_No       = e.Values["Acc_NO"].ToString();
            string Bank_Name    = e.Values["Bank_Name"].ToString();
            string Bank_Address = e.Values["Bank_Address"].ToString();
            int    Default_Acc  = UDFLib.ConvertStringToNull(e.Values["Default_Acc"]) == null ? 0 : UDFLib.ConvertStringToNull(e.Values["Default_Acc"]) == "True" ? 1 : 0;
            int    Verified     = UDFLib.ConvertStringToNull(e.Values["Verified"]) == null ? 0 : UDFLib.ConvertStringToNull(e.Values["Verified"]) == "True" ? 1 : 0;
            string SwiftCode    = e.Values["SwiftCode"].ToString();
            int    Modified_By  = UDFLib.ConvertToInteger(Session["USERID"]);

            string Bank_Code    = e.Values["BANK_CODE"] == null ? "" : e.Values["BANK_CODE"].ToString();
            string Branch_Code  = e.Values["BRANCH_CODE"] == null ? "" : e.Values["BRANCH_CODE"].ToString();
            int    Account_Curr = UDFLib.ConvertToInteger(e.Values["ACCOUNT_CURR"].ToString());
            int    MOBank_ID    = UDFLib.ConvertToInteger(e.Values["MOBank_ID"].ToString());

            int Res = SMS.Business.PortageBill.BLL_PortageBill.ACC_Insert_BankAccounts(CrewID, Beneficiary, Acc_No, Bank_Name, Bank_Address, Default_Acc, Verified, Modified_By, SwiftCode, Bank_Code, Branch_Code, Account_Curr, MOBank_ID);
            if (e.CommandArgument.ToString() == "SaveAndClose")
            {
                string js2 = "parent.hideModal('dvPopupFrame'); parent.GetCrewBankAcc(" + HiddenField_CrewID.Value.ToString() + ");";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js2, true);
            }
            else
            {
                lblMsg.Text = "New Account Details Updated!!";
                string js3 = "parent.GetCrewBankAcc(" + HiddenField_CrewID.Value.ToString() + ");";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js3, true);
            }
        }
    }
    protected void BindWithholdInvoice()
    {
        try
        {
            int    rowcount      = ucCustomPager3.isCountRecord;
            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }
            string InvoiceStatus = (ViewState["InvoiceStatus"] == null) ? null : (ViewState["InvoiceStatus"].ToString());

            DataSet ds = BLL_POLOG_Register.POLOG_Get_Withhold_Invoice_Search(UDFLib.ConvertStringToNull(ddlSupplier.SelectedValue),
                                                                              UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertStringToNull(ddlOwner.SelectedValue), chkUrgent.Checked ? 1 : 0, InvoiceStatus, UDFLib.ConvertIntegerToNull(GetSessionUserID()), sortbycoloumn, sortdirection
                                                                              , ucCustomPager3.CurrentPageIndex, ucCustomPager3.PageSize, ref rowcount);


            if (ucCustomPager3.isCountRecord == 1)
            {
                ucCustomPager3.CountTotalRec = rowcount.ToString();
                ucCustomPager3.BuildPager();
            }

            if (ds.Tables[0].Rows.Count > 0)
            {
                dvWithhold.Visible      = true;
                gvPOWithhold.DataSource = ds.Tables[0];
                gvPOWithhold.DataBind();
                txtPOCode.Text = ds.Tables[0].Rows[0]["SUPPLY_ID"].ToString();
                BindInvoice(ds.Tables[0].Rows[0]["SUPPLY_ID"].ToString());
                gvPOWithhold.Rows[0].BackColor = System.Drawing.Color.Yellow;
            }
            else
            {
                dvWithhold.Visible      = false;
                gvPOWithhold.DataSource = ds.Tables[0];
                gvPOWithhold.DataBind();
            }
        }
        catch { }
        {
        }
    }
Exemplo n.º 12
0
    public void BindGrid()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        string vesselcode = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].ToString());

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }

        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertStringToNull(txtCrew.Text), UDFLib.ConvertStringToNull(ddlRank.SelectedValue)
                                                             , UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), sortbycoloumn, sortdirection
                                                             , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);

        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }

        if (dt.Rows.Count > 0)
        {
            gvDeckLogBook.DataSource = dt;
            gvDeckLogBook.DataBind();
        }
        else
        {
            gvDeckLogBook.DataSource = dt;
            gvDeckLogBook.DataBind();
        }
    }
Exemplo n.º 13
0
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        string vesselcode = (ViewState["VesselCode"] == null) ? null : (ViewState["VesselCode"].ToString());

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }


        DataTable dt = BLL_QMS_RestHours.Get_RestHours_Index(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue), UDFLib.ConvertStringToNull(txtCrew.Text), UDFLib.ConvertStringToNull(ddlRank.SelectedValue),
                                                             UDFLib.ConvertDateToNull(txtfrom.Text), UDFLib.ConvertDateToNull(txtto.Text), sortbycoloumn, sortdirection
                                                             , 1, null, ref rowcount);


        string[] HeaderCaptions  = { "Vessel", "Date", "Code", "Crew Name", "Rank", "Ship's Clocked Hours", "Working Hours", "Rest Hours", "Rest Hours Any 24", "Over Time", "Seafarer's Remarks", "Verifier's Remarks" };
        string[] DataColumnsName = { "Vessel_Name", "REST_HOURS_DATE", "Staff_Code", "Staff_Name", "Staff_rank_Code", "SHIPS_CLOCKED_HOURS", "WORKING_HOURS", "REST_HOURS", "REST_HOURS_ANY24", "OverTime_HOURS", "Seafarer_Remarks", "Verifier_Remarks" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "Rest Hour", "Rest_Hours_Index", "");

        //ExcelDataExport objexp = new ExcelDataExport();
        //objexp.WriteExcell(dt);
    }
    public void BindGridView()
    {
        //try
        //{
        objChangeReqstMerge.AddMergedColumns(new int[] { 5, 6 }, "PO", "HeaderStyle-center");

        ChkStatus();
        int    rowcount      = ucCustomPagerItems.isCountRecord;
        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)

        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }

        if (Session["sVesselCode"] == "0")
        {
            Session["sVesselCode"] = ddlVessel.SelectedValues;
        }
        if (Session["sAccountType"] == "0")
        {
            Session["sAccountType"] = ddlAccountType.SelectedValues;
        }
        if (Session["sAccClassification"] == "0")
        {
            Session["sAccClassification"] = ddlAccClassification.SelectedValues;
        }

        DataSet ds = BLL_POLOG_Register.POLOG_Get_Purchase_Report(UDFLib.ConvertStringToNull(ddlSupplier.SelectedValue),
                                                                  (DataTable)Session["sVesselCode"], (DataTable)Session["sAccountType"], (DataTable)Session["sAccClassification"], CurrStatus,
                                                                  txtFromDate.Text != "" ? Convert.ToDateTime(txtFromDate.Text) : Convert.ToDateTime("01/01/1900"), txtToDate.Text != "" ? Convert.ToDateTime(txtToDate.Text) : Convert.ToDateTime("01/01/1900"),
                                                                  UDFLib.ConvertIntegerToNull(GetSessionUserID()), sortbycoloumn, sortdirection
                                                                  , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }

        if (ds.Tables[0].Rows.Count > 0)
        {
            divPurchase.Visible   = true;
            gvPurchase.DataSource = ds.Tables[0];
            gvPurchase.DataBind();
            Label lblTotOutPOCurAmt1 = (Label)gvPurchase.FooterRow.FindControl("lblTotOutPOCurAmt1");
            Label lblTotPOUSDValue1  = (Label)gvPurchase.FooterRow.FindControl("lblTotPOUSDValue1");
            Label lblTotInvUSDAmt1   = (Label)gvPurchase.FooterRow.FindControl("lblTotInvUSDAmt1");
            Label lblTotPaidUSDAmt1  = (Label)gvPurchase.FooterRow.FindControl("lblTotPaidUSDAmt1");
            lblTotOutPOCurAmt1.Text = ds.Tables[1].Rows[0]["OutStanding_USD_Amount"].ToString();
            lblTotPOUSDValue1.Text  = ds.Tables[1].Rows[0]["PO_USD_Value"].ToString();
            lblTotInvUSDAmt1.Text   = ds.Tables[1].Rows[0]["Invoice_USD_Amount"].ToString();
            lblTotPaidUSDAmt1.Text  = ds.Tables[1].Rows[0]["Paid_USD_Amount"].ToString();
        }
        else
        {
            divPurchase.Visible   = false;
            gvPurchase.DataSource = ds.Tables[0];
            gvPurchase.DataBind();
            gvPurchase.EmptyDataText = "NO RECORDS FOUND";
        }
        // }
        //catch { }
        //{
        //}
    }
Exemplo n.º 15
0
    protected void btnView_Click(object sender, CommandEventArgs e)
    {
        string[] arg = e.CommandArgument.ToString().Split(',');
        txtInvoiceCode.Text = UDFLib.ConvertStringToNull(arg[0]);
        string InvoiceStatus = UDFLib.ConvertStringToNull(arg[1]);
        string PaymentStatus = UDFLib.ConvertStringToNull(arg[2]);
        string Dispute_Flag  = UDFLib.ConvertStringToNull(arg[3]);

        BindAttachment(UDFLib.ConvertStringToNull(txtInvoiceCode.Text));
        BindRemarks(UDFLib.ConvertStringToNull(txtInvoiceCode.Text));
        //BindGrid(InvoiceID);
        BindDuplicateInvoice(UDFLib.ConvertStringToNull(txtInvoiceCode.Text));
        BindDeliveryGrid(UDFLib.ConvertStringToNull(txtInvoiceCode.Text));
        if (Dispute_Flag == "YES")
        {
            btnDispute.Text = "Un-Dispute";
        }
        else
        {
            btnDispute.Text = "Dispute";
        }
        if (InvoiceStatus == "Verified")
        {
            btnInvoiceApprove.Enabled = true;
            btnInvoiceApprove.Text    = "Approve Invoice";
            if (Dispute_Flag == "YES")
            {
                btnInvoiceApprove.Enabled = false;
            }
        }
        else if (InvoiceStatus == "Approved")
        {
            if (Request.QueryString["PageName"] == "FinalApproval")
            {
                btnInvoiceApprove.Visible = false;
                btnPaymentApprove.Visible = false;
                btnFinalApprove.Visible   = true;
                if (PaymentStatus == "")
                {
                    btnFinalApprove.Visible = true;
                    btnFinalApprove.Text    = "Final UnApproval";
                }
                if (Dispute_Flag == "YES")
                {
                    btnFinalApprove.Enabled = false;
                }
                else
                {
                    btnFinalApprove.Enabled = true;
                }
            }
            else if (Request.QueryString["PageName"] == "PaymentApproval")
            {
                if (PaymentStatus == "")
                {
                    btnPaymentApprove.Text = "Approve Payment";
                    dvWithhold.Visible     = true;
                }
                else if (PaymentStatus == "Approved")
                {
                    btnPaymentApprove.Text = "Un-Approve Payment";
                    dvWithhold.Visible     = false;
                }
                if (Dispute_Flag == "YES")
                {
                    btnPaymentApprove.Enabled = false;
                }
                else
                {
                    btnPaymentApprove.Enabled = true;
                }
            }
            else if (Request.QueryString["PageName"] == "InvoiceApproval")
            {
                btnInvoiceApprove.Text = "UnApprove Invoice";
                if (PaymentStatus == "")
                {
                    btnInvoiceApprove.Enabled = true;
                }
                else
                {
                    btnInvoiceApprove.Enabled = false;
                }
                if (Dispute_Flag == "YES")
                {
                    btnInvoiceApprove.Enabled = false;
                }
                else
                {
                    btnInvoiceApprove.Enabled = true;
                }
            }
        }
        else
        {
            btnDispute.Enabled        = true;
            btnInvoiceApprove.Enabled = false;
        }

        foreach (GridViewRow row in gvInvoice.Rows)
        {
            String ID = gvInvoice.DataKeys[row.RowIndex].Values[0].ToString();
            if (txtInvoiceCode.Text == ID)
            {
                row.BackColor = System.Drawing.Color.Yellow;
            }
            else
            {
                row.BackColor = System.Drawing.Color.White;
            }
        }
    }
    protected void BindInvoiceCount()
    {
        try
        {
            DataTable dt = BLL_POLOG_Register.POLOG_Get_Approved_Invoice_Count(UDFLib.ConvertStringToNull(ddlSupplier.SelectedValue),
                                                                               UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertStringToNull(ddlOwner.SelectedValue), chkUrgent.Checked ? 1: 0, UDFLib.ConvertIntegerToNull(GetSessionUserID()));

            if (dt.Rows.Count > 0)
            {
                divInvoiceCount.Visible  = true;
                gvInviceCount.DataSource = dt;
                gvInviceCount.DataBind();
            }
            else
            {
                divInvoiceCount.Visible  = false;
                gvInviceCount.DataSource = dt;
                gvInviceCount.DataBind();
            }
        }
        catch { }
        {
        }
    }
Exemplo n.º 17
0
    public void BindOverDueJobs()
    {
        mergeheadgvOverdue = new MergeGridviewHeader_Info();
        mergeheadgvOverdue.AddMergedColumns(new int[] { 7, 8 }, "Frequency", "PMSGridHeaderStyle-css");
        mergeheadgvOverdue.AddMergedColumns(new int[] { 9, 10 }, "Last Done", "PMSGridHeaderStyle-css");
        mergeheadgvOverdue.AddMergedColumns(new int[] { 14, 15 }, "M/C R. Hrs.", "PMSGridHeaderStyle-css");


        int    rowcount      = ucCustomPagerItems.isCountRecord;
        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }


        DataSet ds = objJobStatus.TecJobOverDueSearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), ucf_DDLVessel.SelectedValues, ucf_DLLLocation.SelectedValues, ucf_DDLSubCatalogue.SelectedValues
                                                      , UDFLib.ConvertIntegerToNull(DDLJobDepartment.SelectedValue), ucf_DDLRank.SelectedValues, UDFLib.ConvertStringToNull(ucf_txtSearchJobTitle.FilterText), ucf_txtSearchJobTitle.FilterType
                                                      , UDFLib.ConvertIntegerToNull(ucf_txtSearchJobID.FilterNumber), ucf_txtSearchJobID.FilterType, ucf_optCritical.SelectedValues, ucf_optCMS.SelectedValues, null, null
                                                      , UDFLib.ConvertIntegerToNull(ddlMonth.SelectedValue), UDFLib.ConvertIntegerToNull(ddlYear.SelectedValue), UDFLib.ConvertStringToNull(optStatus.SelectedValue)
                                                      , sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }

        if (ds.Tables[0].Rows.Count > 0)
        {
            gvOverDueJobs.DataSource = ds.Tables[0];
            gvOverDueJobs.DataBind();

            if (ViewState["Jobid"] == null)
            {
                ViewState["Jobid"]          = ds.Tables[0].Rows[0]["JOB_ID"].ToString();
                ViewState["Job_OverDue_ID"] = ds.Tables[0].Rows[0]["OverDue_ID"].ToString();
                ViewState["Vessel_ID"]      = ds.Tables[0].Rows[0]["Vessel_ID"].ToString();

                gvOverDueJobs.SelectedIndex = 0;
                //BindJobsOverdueHistory(Convert.ToInt32(ViewState["Jobid"].ToString()));
            }

            SetJobOverdueRowSelection();
        }
        else
        {
            gvOverDueJobs.SelectedIndex = -1;
            gvOverDueJobs.DataSource    = ds.Tables[0];
            gvOverDueJobs.DataBind();

            gvJobHistory.DataSource = ds.Tables[0];
            gvJobHistory.DataBind();
        }
    }
Exemplo n.º 18
0
    /// <summary>
    /// to fill machinery running hours data to grid view.
    /// </summary>
    public void BindRuningHours()
    {
        try
        {
            int rowcount = ucCustomPagerItems.isCountRecord;

            DataSet ds = new DataSet();

            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }

            ds = objJobStatus.TecMachineryRunningHoursSearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue),
                                                             UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), null, null, ViewState["RecordDisplayType"].ToString(),
                                                             UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue), UDFLib.ConvertStringToNull(ddlSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0])
                                                             , sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount, chkDisplayInheritingCounter.Checked == true ? 1 : 0);


            if (ViewState["RecordDisplayType"] == "H")
            {
                gvRhrs.Columns[3].Visible = false;
            }
            else
            {
                gvRhrs.Columns[3].Visible = true;
            }


            if (ucCustomPagerItems.isCountRecord == 1)
            {
                ucCustomPagerItems.CountTotalRec = rowcount.ToString();
                ucCustomPagerItems.BuildPager();
            }

            if (ds.Tables[0].Rows.Count > 0)
            {
                gvRhrs.DataSource = ds.Tables[0];
                gvRhrs.DataBind();
            }
            else
            {
                gvRhrs.DataSource = ds.Tables[0];
                gvRhrs.DataBind();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Exemplo n.º 19
0
 private void BindSupplier()
 {
     GrdSupplier.DataSource = BLL_TRV_Supplier.Get_SupplierList(UDFLib.ConvertStringToNull(txtSupplierSearch.Text), RequestID);
     GrdSupplier.DataBind();
 }
Exemplo n.º 20
0
    /// <summary>
    /// Excel export
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            int    rowcount      = ucCustomPagerItems.isCountRecord;
            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }

            DataSet ds = objJobStatus.TecMachineryRunningHoursSearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue)
                                                                     , UDFLib.ConvertDateToNull(txtFromDate.Text), UDFLib.ConvertDateToNull(txtToDate.Text), null, null, ViewState["RecordDisplayType"].ToString(),
                                                                     UDFLib.ConvertIntegerToNull(ddlFunction.SelectedValue), UDFLib.ConvertStringToNull(ddlSystem_location.SelectedValue.Split(',')[1]),
                                                                     UDFLib.ConvertIntegerToNull(ddlSystem_location.SelectedValue.Split(',')[0]), UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[1]),
                                                                     UDFLib.ConvertIntegerToNull(ddlSubSystem_location.SelectedValue.Split(',')[0]), sortbycoloumn, sortdirection, null, null,
                                                                     ref rowcount, chkDisplayInheritingCounter.Checked == true ? 1 : 0);

            string[] HeaderCaptions  = { "Vessel", "System Location", "Sub-System Location", "Date Hours Read", "Differential R.Hours", "Running Hours", "Created by", "Created Date" };
            string[] DataColumnsName = { "Vessel_Name", "Location", "SubLocation", "Date_Hours_Read", "diff_in_Rhrs", "Runing_Hours", "Created_By", "Created_On" };

            GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "Machinery Running Hours", "Machinery Running Hours", "");
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
            string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
        }
    }
    protected void BindGrid()
    {
        string Supplier_Code = GetSupplierCode();
        string Supp_ID       = GetSuppID();

        //txtFileID.Text = GetFileID();
        // int? SuppID = UDFLib.ConvertIntegerToNull(Request.QueryString["Supp_ID"]);
        DataSet ds = BLL_ASL_Supplier.Get_Supplier_Upload_Document(UDFLib.ConvertStringToNull(Supplier_Code), UDFLib.ConvertStringToNull(Supp_ID), "CREDIT", UDFLib.ConvertStringToNull(txtFileID.Text.Trim()));

        //ViewState["RetFileID"] = FileID;
        if (ds.Tables[0].Rows.Count > 0)
        {
            lblVessel.Text = ds.Tables[0].Rows[0]["Vessel_Name"].ToString();
            lblRef.Text    = ds.Tables[0].Rows[0]["Office_Ref_Code"].ToString();
            lblDated.Text  = ds.Tables[0].Rows[0]["LineDate"].ToString();
            lblAmount.Text = ds.Tables[0].Rows[0]["Line_Amount"].ToString();
        }
        if (ds.Tables[1].Rows.Count > 0)
        {
            lblFileName.Text      = ds.Tables[1].Rows[0]["File_Name"].ToString();
            txtInvioceRef.Text    = ds.Tables[1].Rows[0]["Invoice_Reference"].ToString();
            txtInvoiceDate.Text   = ds.Tables[1].Rows[0]["Invoice_Date"].ToString();
            txtInvoiceAmount.Text = ds.Tables[1].Rows[0]["Invoice_Amount"].ToString();

            txtTaxAmount.Text        = ds.Tables[1].Rows[0]["Invoice_GST_Amount"].ToString();
            txtDueDate.Text          = ds.Tables[1].Rows[0]["Invoice_Due_Date"].ToString();
            txtRemarks.Text          = ds.Tables[1].Rows[0]["Invoice_Remarks"].ToString();
            lblInvoiceReferance.Text = ds.Tables[1].Rows[0]["Invoice_Reference"].ToString();
            lblDate.Text             = ds.Tables[1].Rows[0]["Invoice_Date"].ToString();
            lblInvoiceAmount.Text    = ds.Tables[1].Rows[0]["Invoice_Amount"].ToString();
            //lblFileName.Text = ds.Tables[1].Rows[0]["File_Path"].ToString();
            //"../uploads/ASL/"
            string FilePath     = ds.Tables[1].Rows[0]["File_Path"].ToString();
            string FileLocation = HttpContext.Current.Server.MapPath("../Uploads/ASL/Invoice/" + FilePath);
            if (FilePath != "")
            {
                divIframe.Visible         = true;
                iFrame1.Attributes["src"] = @"../Uploads/ASL/Invoice/" + FilePath;
            }
            if (ds.Tables[1].Rows[0]["File_Status"].ToString() == "SUBMITTED")
            {
                DivStep4.Visible         = true;
                btnSubmit.Enabled        = false;
                btnUploadInvoice.Enabled = false;
                btnRecallInvoice.Enabled = true;
            }
        }
        string Type = GetInvoiceType();

        if (Type == "1")
        {
            DivStep3.Visible = true;
        }
        else
        {
            Divstep1.Visible = true;
        }
    }
Exemplo n.º 22
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        int responseid = 0;

        responseid = objBLL.EditCompMailAction(UDFLib.ConvertStringToNull(txtSubject.Text), UDFLib.ConvertStringToNull(txtMailTo.Text), UDFLib.ConvertStringToNull(txtMailCc.Text), UDFLib.ConvertStringToNull(txtemailbody.Text), int.Parse(txtMailID.Text), Convert.ToInt32(Session["USERID"]));


        BindCompany_MailAction();
        string hidemodal = String.Format("hideModal('divadd')");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
    }
Exemplo n.º 23
0
    public void BindDataItems()
    {
        int is_Fetch_Count = ucCustomPagerPO.isCountRecord;

        gvOrderList.DataSource = BLL_PURC_LOG.Get_Log_PO_List(int.Parse(DDLVessel.SelectedValue), UDFLib.ConvertStringToNull(uc_SupplierList1.SelectedValue), UDFLib.ConvertStringToNull(txtPoNumber.Text), ucCustomPagerPO.CurrentPageIndex, ucCustomPagerPO.PageSize, ref is_Fetch_Count);
        gvOrderList.DataBind();

        ucCustomPagerPO.CountTotalRec = is_Fetch_Count.ToString();
        ucCustomPagerPO.BuildPager();
    }
Exemplo n.º 24
0
    /// <summary>
    /// Method to add or modify the port call setails
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnsave_Click(object sender, EventArgs e)
    {
        try
        {
            string   ArrivalTime    = ddlArrHour.SelectedValue + ":" + ddlArrMin.SelectedValue;
            string   BerthingTime   = ddlBerthingHour.Text + ":" + ddlBerthingMin.SelectedValue;
            string   DepartureTime  = ddlDepHr.Text + ":" + ddlDepmin.SelectedValue;
            bool     bAutoDate      = chkAutoDate.Checked;
            string   PortCallStatus = "";
            DateTime Berthingdt;
            int      str          = 0;
            int      PortId       = 0;
            string   PortLocation = string.Empty;
            //Done changes for the Date format issue on save
            var Arrival  = "";
            var Dep      = "";
            var Berthing = "";
            if (dtpArrival.Text != "")
            {
                Arrival = UDFLib.ConvertToDefaultDt(dtpArrival.Text);
            }
            if (dtpDeparture.Text != "")
            {
                Dep = UDFLib.ConvertToDefaultDt(dtpDeparture.Text);
            }
            if (dtpBerthing.Text != "")
            {
                Berthing = UDFLib.ConvertToDefaultDt(dtpBerthing.Text);
            }


            if (dtpBerthing.Text == "")
            {
                Berthingdt = Convert.ToDateTime(Arrival + " " + ArrivalTime);
            }
            else
            {
                Berthingdt = Convert.ToDateTime(Berthing + " " + BerthingTime);
            }
            if (chkNewLocation.Checked == false)
            {
                PortId = UDFLib.ConvertToInteger(DDLPort.SelectedValue);
            }
            else
            {
                PortLocation = txtlocation.Text;
            }


            if (dtpArrival.Text.Trim() != "" && dtpDeparture.Text.Trim() != "")
            {
                DateTime Arrivaldt = Convert.ToDateTime(Arrival + " " + ArrivalTime);
                DateTime Depdt     = Convert.ToDateTime(Dep + " " + DepartureTime);

                ViewState["dtpArrival"]   = Arrival;
                ViewState["dtpDeparture"] = Dep;
                ViewState["ddlArrHour"]   = ddlArrHour.SelectedValue;
                ViewState["ddlArrMin"]    = ddlArrMin.SelectedValue;
                ViewState["ddlDepHr"]     = ddlDepHr.SelectedValue;
                ViewState["ddlDepmin"]    = ddlDepmin.SelectedValue;


                if (Arrivaldt > Berthingdt)
                {
                    lbl1.Text = "Berthing Date can't be before of Arrival Date.";
                }
                else if (Arrivaldt > Depdt)
                {
                    lbl1.Text = "Departure Date can't be before of Arrival Date.";
                }
                else if (Berthingdt > Depdt)
                {
                    lbl1.Text = "Departure Date can't be before of Berthing Date.";
                }
                else
                {
                    if (UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]) == 0)
                    {
                        str = objPortCall.Ins_PortCall_Details(UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]), UDFLib.ConvertToInteger(ddlVessel.SelectedValue), PortId
                                                               , UDFLib.ConvertDateToNull(Arrival)
                                                               , UDFLib.ConvertStringToNull(Berthing)
                                                               , UDFLib.ConvertDateToNull(Dep), UDFLib.ConvertStringToNull(ArrivalTime),
                                                               UDFLib.ConvertStringToNull(BerthingTime), UDFLib.ConvertStringToNull(DepartureTime)
                                                               , txtPortRemark.Text, UDFLib.ConvertStringToNull(ddlOwnersAgent.SelectedValue), UDFLib.ConvertStringToNull(ddlCharterAgent.SelectedValue)
                                                               , Convert.ToInt32(GetSessionUserID()), Convert.ToInt32(chkWarRisk.Checked), Convert.ToInt32(chkShipCrane.Checked), PortCallStatus, PortLocation, bAutoDate);
                        //str = objPortCall.Ins_PortCall_Details(UDFLib.ConvertIntegerToNull(str));
                    }
                    else
                    {
                        if (chkPortCallStatus.Checked == true)
                        {
                            PortCallStatus = "OMITTED";
                        }
                        str = objPortCall.Upd_PortCall_Details(UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]), UDFLib.ConvertToInteger(ddlVessel.SelectedValue), PortId
                                                               , UDFLib.ConvertDateToNull(Arrival)
                                                               , UDFLib.ConvertStringToNull(Berthing)
                                                               , UDFLib.ConvertDateToNull(Dep), UDFLib.ConvertStringToNull(ArrivalTime),
                                                               UDFLib.ConvertStringToNull(BerthingTime), UDFLib.ConvertStringToNull(DepartureTime)
                                                               , txtPortRemark.Text, UDFLib.ConvertStringToNull(ddlOwnersAgent.SelectedValue), UDFLib.ConvertStringToNull(ddlCharterAgent.SelectedValue)
                                                               , Convert.ToInt32(GetSessionUserID()), Convert.ToInt32(chkWarRisk.Checked), Convert.ToInt32(chkShipCrane.Checked), PortCallStatus, PortLocation, bAutoDate);
                    }
                    if (str == -1)
                    {
                        lbl1.Text = "Input Date should not come in between existing arrival/departure Date .";
                    }
                    else if (str == -2)
                    {
                        lbl1.Text = "Input Date should not come in between existing arrival/departure Date .";
                    }
                    else if (str == -3)
                    {
                        lbl1.Text = "Input Date time should not be less than previous port call time.";
                    }
                    else
                    {
                        //str = objPortCall.Ins_PortCall_Details(UDFLib.ConvertIntegerToNull(str));
                        string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
                    }
                }
            }
            else
            {
                if (UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]) == 0)
                {
                    if (dtpArrival.Text != "" && dtpBerthing.Text != "")
                    {
                        if (Convert.ToDateTime(Berthing) < Convert.ToDateTime(Arrival))
                        {
                            lbl1.Text = "Berthing Date can't be before of Arrival Date.";
                        }
                        else
                        {
                            str = objPortCall.Ins_PortCall_Details(UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]), UDFLib.ConvertToInteger(ddlVessel.SelectedValue), PortId
                                                                   , UDFLib.ConvertDateToNull(Arrival)
                                                                   , UDFLib.ConvertStringToNull(Berthing)
                                                                   , UDFLib.ConvertDateToNull(Dep), UDFLib.ConvertStringToNull(ArrivalTime),
                                                                   UDFLib.ConvertStringToNull(BerthingTime), UDFLib.ConvertStringToNull(DepartureTime)
                                                                   , txtPortRemark.Text, UDFLib.ConvertStringToNull(ddlOwnersAgent.SelectedValue), UDFLib.ConvertStringToNull(ddlCharterAgent.SelectedValue)
                                                                   , Convert.ToInt32(GetSessionUserID()), Convert.ToInt32(chkWarRisk.Checked), Convert.ToInt32(chkShipCrane.Checked), PortCallStatus, PortLocation, bAutoDate);
                            string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
                        }
                    }
                    else if (dtpBerthing.Text != "" && dtpDeparture.Text != "")
                    {
                        if (Convert.ToDateTime(dtpDeparture.Text) < Convert.ToDateTime(dtpBerthing.Text))
                        {
                            lbl1.Text = "Departure Date can't be before of Berthing Date.";
                        }
                        else
                        {
                            str = objPortCall.Ins_PortCall_Details(UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]), UDFLib.ConvertToInteger(ddlVessel.SelectedValue), PortId
                                                                   , UDFLib.ConvertDateToNull(Arrival)
                                                                   , UDFLib.ConvertStringToNull(Berthing)
                                                                   , UDFLib.ConvertDateToNull(Dep), UDFLib.ConvertStringToNull(ArrivalTime),
                                                                   UDFLib.ConvertStringToNull(BerthingTime), UDFLib.ConvertStringToNull(DepartureTime)
                                                                   , txtPortRemark.Text, UDFLib.ConvertStringToNull(ddlOwnersAgent.SelectedValue), UDFLib.ConvertStringToNull(ddlCharterAgent.SelectedValue)
                                                                   , Convert.ToInt32(GetSessionUserID()), Convert.ToInt32(chkWarRisk.Checked), Convert.ToInt32(chkShipCrane.Checked), PortCallStatus, PortLocation, bAutoDate);

                            string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
                        }
                    }
                    else
                    {
                        str = objPortCall.Ins_PortCall_Details(UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]), UDFLib.ConvertToInteger(ddlVessel.SelectedValue), PortId
                                                               , UDFLib.ConvertDateToNull(Arrival)
                                                               , UDFLib.ConvertStringToNull(Berthing)
                                                               , UDFLib.ConvertDateToNull(Dep), UDFLib.ConvertStringToNull(ArrivalTime),
                                                               UDFLib.ConvertStringToNull(BerthingTime), UDFLib.ConvertStringToNull(DepartureTime)
                                                               , txtPortRemark.Text, UDFLib.ConvertStringToNull(ddlOwnersAgent.SelectedValue), UDFLib.ConvertStringToNull(ddlCharterAgent.SelectedValue)
                                                               , Convert.ToInt32(GetSessionUserID()), Convert.ToInt32(chkWarRisk.Checked), Convert.ToInt32(chkShipCrane.Checked), PortCallStatus, PortLocation, bAutoDate);
                        string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
                    }
                }
                else
                {
                    if (chkPortCallStatus.Checked == true)
                    {
                        PortCallStatus = "OMITTED";
                    }


                    if (dtpArrival.Text != "" && dtpBerthing.Text != "")
                    {
                        if (Convert.ToDateTime(dtpBerthing.Text) < Convert.ToDateTime(dtpArrival.Text))
                        {
                            lbl1.Text = "Berthing Date can't be before of Arrival Date.";
                        }
                        else
                        {
                            str = objPortCall.Upd_PortCall_Details(UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]), UDFLib.ConvertToInteger(ddlVessel.SelectedValue), PortId
                                                                   , UDFLib.ConvertDateToNull(Arrival)
                                                                   , UDFLib.ConvertStringToNull(Berthing)
                                                                   , UDFLib.ConvertDateToNull(Dep), UDFLib.ConvertStringToNull(ArrivalTime),
                                                                   UDFLib.ConvertStringToNull(BerthingTime), UDFLib.ConvertStringToNull(DepartureTime)
                                                                   , txtPortRemark.Text, UDFLib.ConvertStringToNull(ddlOwnersAgent.SelectedValue), UDFLib.ConvertStringToNull(ddlCharterAgent.SelectedValue)
                                                                   , Convert.ToInt32(GetSessionUserID()), Convert.ToInt32(chkWarRisk.Checked), Convert.ToInt32(chkShipCrane.Checked), PortCallStatus, PortLocation, bAutoDate);

                            string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
                        }
                    }
                    else if (dtpBerthing.Text != "" && dtpDeparture.Text != "")
                    {
                        if (Convert.ToDateTime(dtpDeparture.Text) < Convert.ToDateTime(dtpBerthing.Text))
                        {
                            lbl1.Text = "Departure Date can't be before of Berthing Date.";
                        }
                        else
                        {
                            str = objPortCall.Upd_PortCall_Details(UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]), UDFLib.ConvertToInteger(ddlVessel.SelectedValue), PortId
                                                                   , UDFLib.ConvertDateToNull(Arrival)
                                                                   , UDFLib.ConvertStringToNull(Berthing)
                                                                   , UDFLib.ConvertDateToNull(Dep), UDFLib.ConvertStringToNull(ArrivalTime),
                                                                   UDFLib.ConvertStringToNull(BerthingTime), UDFLib.ConvertStringToNull(DepartureTime)
                                                                   , txtPortRemark.Text, UDFLib.ConvertStringToNull(ddlOwnersAgent.SelectedValue), UDFLib.ConvertStringToNull(ddlCharterAgent.SelectedValue)
                                                                   , Convert.ToInt32(GetSessionUserID()), Convert.ToInt32(chkWarRisk.Checked), Convert.ToInt32(chkShipCrane.Checked), PortCallStatus, PortLocation, bAutoDate);
                            string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
                        }
                    }
                    else
                    {
                        str = objPortCall.Upd_PortCall_Details(UDFLib.ConvertToInteger(ViewState["ReturnPortCallID"]), UDFLib.ConvertToInteger(ddlVessel.SelectedValue), PortId
                                                               , UDFLib.ConvertDateToNull(Arrival)
                                                               , UDFLib.ConvertStringToNull(Berthing)
                                                               , UDFLib.ConvertDateToNull(Dep), UDFLib.ConvertStringToNull(ArrivalTime),
                                                               UDFLib.ConvertStringToNull(BerthingTime), UDFLib.ConvertStringToNull(DepartureTime)
                                                               , txtPortRemark.Text, UDFLib.ConvertStringToNull(ddlOwnersAgent.SelectedValue), UDFLib.ConvertStringToNull(ddlCharterAgent.SelectedValue)
                                                               , Convert.ToInt32(GetSessionUserID()), Convert.ToInt32(chkWarRisk.Checked), Convert.ToInt32(chkShipCrane.Checked), PortCallStatus, PortLocation, bAutoDate);
                        string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
                    }
                }
                //str = objPortCall.Ins_PortCall_Details(UDFLib.ConvertIntegerToNull(str));
            }
        }
        catch (Exception ex)
        {
            string Error = ex.ToString();
        }
    }
Exemplo n.º 25
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         string Hide = "No";
         if (chkHide.Checked == true)
         {
             Hide = "Yes";
         }
         else
         {
             Hide = "No";
         }
         string Action_On_Data_Form = null;
         string Status = null;
         int    Retval = BLL_POLOG_Register.POLOG_Update_PO_Admin(UDFLib.ConvertIntegerToNull(txtSupplyID.Text.ToString()), UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertStringToNull(ddlSupplier.SelectedValue),
                                                                  UDFLib.ConvertIntegerToNull(ddlTerms.SelectedValue), UDFLib.ConvertStringToNull(ddlCurrency.SelectedValue), UDFLib.ConvertStringToNull(ddlIssueBy.SelectedValue),
                                                                  UDFLib.ConvertStringToNull(ddlCharterParty.SelectedValue), UDFLib.ConvertStringToNull(ddlAccClassifictaion.SelectedValue), UDFLib.ConvertStringToNull(ddlAccountType.SelectedValue), UDFLib.ConvertStringToNull(ddlPOType.SelectedValue),
                                                                  UDFLib.ConvertStringToNull(ddlOwnerCode.SelectedValue), UDFLib.ConvertStringToNull(rdbPayment.SelectedValue), Hide, txtRemarks.Text.ToString(), Action_On_Data_Form, Status, UDFLib.ConvertIntegerToNull(Session["USERID"].ToString()));
         string script = "alert(\"PO Log details have been successfully updated\");";
         ScriptManager.RegisterStartupScript(this, GetType(),
                                             "ServerControlScript", script, true);
     }
     catch { }
     {
     }
 }
Exemplo n.º 26
0
    protected void BindItems()
    {
        DateTime?sFromDate;
        DateTime?sToDate;

        if (ViewState["sFromDT"].ToString() == "")
        {
            sFromDate = null;
        }
        else
        {
            sFromDate = UDFLib.ConvertDateToNull(ViewState["sFromDT"]);
        }
        if (ViewState["sToDT"].ToString() == "")
        {
            sToDate = null;
        }
        else
        {
            sToDate = UDFLib.ConvertDateToNull(ViewState["sToDT"]);
        }

        int Record_count = 0;

        gvPortReport.DataSource = BLL_OPS_VoyageReports.Get_PortReportIndex(Convert.ToInt32(ViewState["iVesselID"]), sFromDate, sToDate, UDFLib.ConvertStringToNull(ViewState["Sort_Column"]), UDFLib.ConvertStringToNull(ViewState["Sort_Direction"]),
                                                                            UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CurrentPageIndex),
                                                                            UDFLib.ConvertIntegerToNull(ucCustomPagerItems.PageSize), ref Record_count);

        gvPortReport.DataBind();

        ucCustomPagerItems.CountTotalRec = Record_count.ToString();
        ucCustomPagerItems.BuildPager();
    }
Exemplo n.º 27
0
    public void BindSysVariableGrid()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }


        DataTable dt = objBLLSysVariable.Get_SysVariable_Search(txtNameFilter.Text != "" ? txtNameFilter.Text : null, UDFLib.ConvertStringToNull(ddlVariableTypeFilter.SelectedValue), sortbycoloumn, sortdirection
                                                                , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }

        if (dt.Rows.Count > 0)
        {
            gvVariable.DataSource = dt;
            gvVariable.DataBind();
        }
        else
        {
            gvVariable.DataSource = dt;
            gvVariable.DataBind();
        }
    }
Exemplo n.º 28
0
    public void BindDataItems()
    {
        int?ShowAllUser    = (chkShowAll.Checked) ? UDFLib.ConvertIntegerToNull(0) : Convert.ToInt32(Session["userid"]);
        int?ShowActive     = (chkShowActive.Checked) ? 1 : 0;
        int is_Fetch_Count = ucCustomPagerPO.isCountRecord;

        gvOrderList.DataSource = BLL_PURC_LOG.Get_Log_LogisticPO_List((DataTable)DDLFleet.SelectedValues, (DataTable)DDLVessel.SelectedValues, UDFLib.ConvertStringToNull(uc_SupplierList1.SelectedValue), UDFLib.ConvertStringToNull(txtPoNumber.Text), ShowAllUser, null, UDFLib.ConvertStringToNull(ViewState["LOG_STATUS"]), ucCustomPagerPO.CurrentPageIndex, ucCustomPagerPO.PageSize, ref is_Fetch_Count);
        gvOrderList.DataBind();

        ucCustomPagerPO.CountTotalRec = is_Fetch_Count.ToString();
        ucCustomPagerPO.BuildPager();
    }
Exemplo n.º 29
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }

        DataTable dt = objBLLSysVariable.Get_SysVariable_Search(txtNameFilter.Text != "" ? txtNameFilter.Text : null, UDFLib.ConvertStringToNull(ddlVariableTypeFilter.SelectedValue), sortbycoloumn, sortdirection
                                                                , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);

        string[] HeaderCaptions  = { "Variable Type", "Variable Name", "Variable Code", "Variable Value", "Color Code" };
        string[] DataColumnsName = { "Variable_Type", "Variable_Name", "Variable_Code", "VARIABLE_VALUE", "COLOR_CODE" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "System Variable", "System Variable", "");
    }
Exemplo n.º 30
0
    public void BindALLRequistionsDetails()
    {
        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            DataTable dtAllRequisition = new DataTable();
            switch (Request.QueryString["Type"])
            {
            case "ALL":

                int    Fetch_Count   = ucCustomPagerAllStatus.isCountRecord;
                string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
                string sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
                {
                    sortdirection = (ViewState["SORTDIRECTION"].ToString());
                }
                dtAllRequisition = objTechService.SelectAllRequisitionStages_New
                                       (UDFLib.ConvertStringToNull(Session["sFleet"]), UDFLib.ConvertStringToNull(Session["sVesselCode"])
                                       , UDFLib.ConvertStringToNull(Session["sDeptType"])
                                       , UDFLib.ConvertStringToNull(Session["sPurc_Dept"])
                                       , UDFLib.ConvertStringToNull(Session["REQNUM"])
                                       , UDFLib.ConvertStringToNull(Session["sPOType"])
                                       , UDFLib.ConvertStringToNull(Session["sAccType"])
                                       , UDFLib.ConvertStringToNull(Session["ReqsnType"])
                                       , UDFLib.ConvertStringToNull(Session["sCatalogue"])
                                       , UDFLib.ConvertDateToNull(Session["sFrom"])
                                       , UDFLib.ConvertDateToNull(Session["sTO"])
                                       , UDFLib.ConvertStringToNull(Session["sAccClass"])
                                       , UDFLib.ConvertStringToNull(Session["dturgrcy"])
                                       , UDFLib.ConvertStringToNull((Session["sReqsnStatus"]))

                                       , ucCustomPagerAllStatus.CurrentPageIndex,
                                       ucCustomPagerAllStatus.PageSize,
                                       ref Fetch_Count, sortbycoloumn, UDFLib.ConvertStringToNull(sortdirection));

                //dtAllRequisition = objTechService.SelectAllRequisitionStages((DataTable)Session["sFleet"], (DataTable)Session["sVesselCode"],
                //                                                             (DataTable)Session["sDeptCode"],
                //                                                             UDFLib.ConvertStringToNull(Session["sDeptType"]),
                //                                                             UDFLib.ConvertStringToNull(Session["REQNUM"]),
                //                                                             UDFLib.ConvertIntegerToNull(Session["ReqsnType"]),
                //                                                             UDFLib.ConvertStringToNull(ddlReqsnStatus.SelectedValue),
                //                                                             ucCustomPagerAllStatus.CurrentPageIndex,
                //                                                             ucCustomPagerAllStatus.PageSize,
                //                                                             ref Fetch_Count, sortbycoloumn, sortdirection);

                if (ucCustomPagerAllStatus.isCountRecord == 1)
                {
                    ucCustomPagerAllStatus.CountTotalRec = Fetch_Count.ToString();
                    ucCustomPagerAllStatus.BuildPager();
                }

                break;
            }


            if (ddlReqsnStatus.SelectedValue != "")
            {
                Session["PURC_ReqsnStatusATAll"] = ddlReqsnStatus.SelectedValue;
            }
            Session["PURC_ReqsnStatusATAll"] = "";

            rgdAllReqStatus.DataSource = dtAllRequisition;

            if (ViewState["NeedDataSource"].ToString() == "0")
            {
                rgdAllReqStatus.DataBind();
            }

            string script = " var height = document.body.scrollHeight;parent.ResizeFromChild(height,'1');";
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "resize" + DateTime.Now.Millisecond.ToString(), script, true);
        }
    }