Exemple #1
0
    private void BindItems()
    {
        try
        {
            DataSet   ds        = objCP.GET_Billing_Items_Detail(UDFLib.ConvertIntegerToNull(Session["CPID"]));
            DataTable dt        = ds.Tables[0];
            string[]  Pkey_cols = new string[] { "Billing_Item_Id" };
            string[]  Hide_cols = new string[] { "Trading_Range_Id", "CPID" };
            DataTable dt1       = PivotTable("WEF_Date", "Item_Amount", "Trading_Range_Id", Pkey_cols, Hide_cols, dt);
            if (dt1.Rows.Count > 0)
            {
                dtGridItems         = dt1;
                rgdItems.DataSource = dt1;
                rgdItems.DataBind();
            }
            else
            {
                rgdItems.DataSource = dtGridItems;
                rgdItems.DataBind();

                //rgdItems.MasterTableView.Columns[9].Visible = false;
            }
            ViewState["dtGridItems"] = dtGridItems;
        }
        catch (Exception ex)
        {
            //lblError.Text = ex.ToString();
            //.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex);
        }
        finally
        {
        }
    }
Exemple #2
0
    protected void onDelete(object source, CommandEventArgs e)
    {
        HiddenField lblgrdID = (rgdItems.FindControl("hdnTPId") as HiddenField);

        string[] arg    = e.CommandArgument.ToString().Split(',');
        int?     ItemID = UDFLib.ConvertIntegerToNull(arg[0]);
    }
    /// <summary>
    ///  Append or Overwrite Item on another function on Copy Items Button Click
    /// </summary>
    protected void MoveItemsToOtherSubsystem(string action)
    {
        try
        {
            if (action != "APPEND")
            {
                int result = objItems.PURC_Items_COPY_OVERWRITE(DDLFromSystem.SelectedValue, DDLFromSubsystem.SelectedValue
                                                                , DDLFromVessel.SelectedValue, Session["USERID"].ToString(), DDLToSystem.SelectedValue, DDLToSubsystem.SelectedValue
                                                                , DDLToVessel.SelectedValue);
            }
            else
            {
                int result = objItems.PURC_Items_COPY_Append(UDFLib.ConvertStringToNull(DDLFromSystem.SelectedValue), UDFLib.ConvertIntegerToNull(DDLFromSubsystem.SelectedValue)
                                                             , UDFLib.ConvertIntegerToNull(DDLFromVessel.SelectedValue)


                                                             , UDFLib.ConvertStringToNull(DDLToSystem.SelectedValue), UDFLib.ConvertStringToNull(DDLToSubsystem.SelectedValue), 1, Session["USERID"].ToString());
            }
            String script = String.Format("parent.RefreshFromchild();parent.hideModal('dvMoveJobsPopUp'); "); /*dvCopyJobsPopUp is replaced with dvMoveJobsPopUp*/
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", script, true);
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    protected void btnFinalize_Click(object sender, EventArgs e)
    {
        try
        {
            int RetValue = BLL_ASL_Supplier.Supplier_Data_Insert(UDFLib.ConvertIntegerToNull(ViewState["ReturnSupplierID"].ToString())
                                                                 , UDFLib.ConvertStringToNull(Request.QueryString["Supp_ID"])
                                                                 , UDFLib.ConvertStringToNull(txtCompanyResgName.Text.Trim()), UDFLib.ConvertStringToNull(txtSuppAddress.Text.Trim()), UDFLib.ConvertStringToNull(txtState.Text.Trim()), UDFLib.ConvertStringToNull(ddlCountry.SelectedItem.Text), UDFLib.ConvertIntegerToNull(ddlCountry.SelectedValue), UDFLib.ConvertStringToNull(txtPostalCode.Text),
                                                                 UDFLib.ConvertStringToNull(txtTelephone1.Text.Trim()), UDFLib.ConvertStringToNull(txtTelephone2.Text.Trim()), UDFLib.ConvertStringToNull(txtAOHNumber1.Text.Trim()), UDFLib.ConvertStringToNull(txtAOHNumber2.Text.Trim()), UDFLib.ConvertStringToNull(txtFaxNumber1.Text.Trim()), UDFLib.ConvertStringToNull(txtFaxNumber2.Text.Trim()), UDFLib.ConvertStringToNull(txtCompanyEmail1.Text.Trim()), UDFLib.ConvertStringToNull(txtCompanyEmail2.Text.Trim())
                                                                 , UDFLib.ConvertStringToNull(txtCompanyWebSite.Text.Trim()), UDFLib.ConvertStringToNull(txtCompanyRegNo.Text.Trim()), UDFLib.ConvertStringToNull(txtGstTaxRegNo.Text.Trim()), UDFLib.ConvertStringToNull(txtISOCertification.Text.Trim()), UDFLib.ConvertStringToNull(ddlBillingCurrency.SelectedItem.Text), UDFLib.ConvertIntegerToNull(ddlBillingCurrency.SelectedValue)
                                                                 , ddlTitle1.SelectedValue, ddlTitle2.SelectedValue, UDFLib.ConvertStringToNull(txtNamePIC1.Text.Trim()), UDFLib.ConvertStringToNull(txtNamePIC2.Text.Trim()), UDFLib.ConvertStringToNull(txtDesignation1.Text.Trim()), UDFLib.ConvertStringToNull(txtDesignation2.Text.Trim())
                                                                 , UDFLib.ConvertStringToNull(txtEmailPIC1.Text.Trim()), UDFLib.ConvertStringToNull(txtEmailPIC2.Text.Trim()), UDFLib.ConvertStringToNull(txtPhonePIC1.Text.Trim()), UDFLib.ConvertStringToNull(txtPhonePIC2.Text.Trim()), UDFLib.ConvertStringToNull(txtBankName.Text.Trim()), UDFLib.ConvertStringToNull(txtBankAddress.Text.Trim()), UDFLib.ConvertStringToNull(txtBankCode.Text.Trim())
                                                                 , UDFLib.ConvertStringToNull(txtBranchCode.Text.Trim()), UDFLib.ConvertStringToNull(txtSwiftCode.Text.Trim()), UDFLib.ConvertStringToNull(txtIBANCode.Text.Trim()), UDFLib.ConvertStringToNull(txtBeneficiaryName.Text.Trim()), UDFLib.ConvertStringToNull(txtBeneficiaryAddress.Text.Trim()), UDFLib.ConvertStringToNull(txtBeneficiaryAccount.Text.Trim())
                                                                 , UDFLib.ConvertStringToNull(ddlAccountCurrency.SelectedValue), UDFLib.ConvertStringToNull(txtNotifypayment.Text.Trim()), UDFLib.ConvertStringToNull(txtNotificationEmail.Text.Trim()), UDFLib.ConvertStringToNull(txtVerifiedName.Text.Trim())
                                                                 , UDFLib.ConvertStringToNull(ddlDesignation.SelectedValue), "VERIFIED", UDFLib.ConvertToInteger(Session["UserID"].ToString()), UDFLib.ConvertStringToNull(txtSkypeAdd.Text.Trim()), UDFLib.ConvertStringToNull(txtSkypeAdd2.Text.Trim()),
                                                                 UDFLib.ConvertStringToNull(txtMobileNo.Text.Trim()), UDFLib.ConvertStringToNull(txtMobileNo2.Text.Trim()), UDFLib.ConvertStringToNull(txtScope.Text.Trim()), UDFLib.ConvertStringToNull(txtAddService.Text.Trim()), UDFLib.ConvertStringToNull(txtBankInfo.Text.Trim()), UDFLib.ConvertStringToNull(txtTaxAccNumber.Text));


            ViewState["ReturnSupplierID"] = RetValue;

            BindSupplierDataList();
            string message = "alert('Supplier data has been Verified.')";
            ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Exemple #5
0
    public void Load_dropdownlist()
    {
        string  SearchType = "PAYMENT";
        DataSet ds         = BLL_POLOG_Register.POLOG_Get_Supplier_InvoiceWise(UDFLib.ConvertIntegerToNull(GetSessionUserID()), SearchType);

        if (ds.Tables[0].Rows.Count > 0)
        {
            ddlSupplier.DataSource     = ds.Tables[0];
            ddlSupplier.DataTextField  = "Supplier_Name";
            ddlSupplier.DataValueField = "Supplier_Code";
            ddlSupplier.DataBind();
            ddlSupplier.Items.Insert(0, new ListItem("-All-", "0"));
        }
        else
        {
            ddlSupplier.Items.Insert(0, new ListItem("-All-", "0"));
        }
        if (ds.Tables[1].Rows.Count > 0)
        {
            ddlVessel.DataSource     = ds.Tables[1];
            ddlVessel.DataTextField  = "Vessel_Name";
            ddlVessel.DataValueField = "Vessel_ID";
            ddlVessel.DataBind();
            ddlVessel.Items.Insert(0, new ListItem("-All-", "0"));
        }
        else
        {
            ddlVessel.Items.Insert(0, new ListItem("-All-", "0"));
        }
    }
 protected void BindPODetails()
 {
     try
     {
         DataSet ds = BLL_POLOG_Register.POLOG_Get_PO_Deatils(UDFLib.ConvertIntegerToNull(txtPOCode.Text.ToString()), null, 0);
         if (ds.Tables[0].Rows.Count > 0)
         {
             DataRow dr = ds.Tables[0].Rows[0];
             lblSupplyID.Text     = dr["SUPPLY_ID"].ToString();
             lblPOCode.Text       = dr["Office_Ref_Code"].ToString();
             lblPoAmount.Text     = dr["Total_Amt"].ToString();
             lblDays.Text         = dr["PaymentTermsDays"].ToString();
             lblSuppliername.Text = dr["Supplier_name"].ToString();
             if (dr["PO_Closed_Date"].ToString() != "")
             {
                 lblPOClose.Visible = true;
                 ImgAdd.Enabled     = false;
                 //btnAdvanceRequest.Enabled = false;
             }
             else
             {
                 lblPOClose.Visible = false;
                 ImgAdd.Enabled     = true;
                 //btnAdvanceRequest.Enabled = true;
             }
         }
     }
     catch { }
     {
     }
 }
Exemple #7
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        if (HiddenFlag.Value == "Add")
        {
            int retval = objBLLAirPort.Insert_AirPort(txtIndent.Text, UDFLib.ConvertStringToNull(ddlAirportType.SelectedValue), txtAirPortName.Text
                                                      , txtLatDeg.Text, txtLonDeg.Text, UDFLib.ConvertIntegerToNull(txtElevation.Text), txtContinent.Text, txtISOCountry.Text
                                                      , UDFLib.ConvertIntegerToNull(ddlAirportCountry.SelectedValue)
                                                      , txtisoregion.Text, txtMunicipal.Text, rdoScheculeService.SelectedValue, txtGpsCode.Text, txtIataCode.Text
                                                      , txtLocalCode.Text, Convert.ToInt32(Session["USERID"]));
        }
        else
        {
            int retval = objBLLAirPort.Edit_AirPort(Convert.ToInt32(txtAirPortID.Text), txtIndent.Text, UDFLib.ConvertStringToNull(ddlAirportType.SelectedValue), txtAirPortName.Text
                                                    , txtLatDeg.Text, txtLonDeg.Text, UDFLib.ConvertIntegerToNull(txtElevation.Text), txtContinent.Text, txtISOCountry.Text
                                                    , UDFLib.ConvertIntegerToNull(ddlAirportCountry.SelectedValue)
                                                    , txtisoregion.Text, txtMunicipal.Text, rdoScheculeService.SelectedValue, txtGpsCode.Text, txtIataCode.Text
                                                    , txtLocalCode.Text, Convert.ToInt32(Session["USERID"]));
        }

        BindAirPortGrid();

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

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
    }
    protected void btnsave_Click(object sender, EventArgs e)
    {
        int responseid = 0;

        if (HiddenFlag.Value == "Add")
        {
            responseid = objBLL.InsertDrillType(UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertStringToNull(ddlDrillName.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFrequency.SelectedValue), Convert.ToInt32(Session["USERID"]));
        }
        else
        {
            responseid = objBLL.EditDrillType(UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertStringToNull(ddlDrillName.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFrequency.SelectedValue), int.Parse(txtDrillID.Text), Convert.ToInt32(Session["USERID"]));
        }
        if (responseid > 0)
        {
            BindDrillType();
            string hidemodal = String.Format("hideModal('divadd')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
        else
        {
            lblMsg.Text = "Vessel Name And Drill Name Already Exists!";
            string AddDeptmodal = String.Format("showModal('divadd',false);");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddDeptmodal", AddDeptmodal, true);
        }
    }
    public void BindDrillType()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;
        //int? isfavorite = null; if (ddlFavorite.SelectedValue != "2") isfavorite = Convert.ToInt32(ddlFavorite.SelectedValue.ToString());
        //int? countrycode = null; if (ddlSearchCountry.SelectedValue != "0") countrycode = Convert.ToInt32(ddlSearchCountry.SelectedValue.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 = objBLL.SearchDrillType(UDFLib.ConvertIntegerToNull(ddlVessel_Name.SelectedValue), UDFLib.ConvertStringToNull(ddlDrill_Name.SelectedValue), sortbycoloumn, sortdirection
                                              , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


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


        if (dt.Rows.Count > 0)
        {
            gvWorkListAccess.DataSource = dt;
            gvWorkListAccess.DataBind();
        }
        else
        {
            gvWorkListAccess.DataSource = dt;
            gvWorkListAccess.DataBind();
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strKey = "";
        int    val    = 0;

        //if (rbtAllItems.Checked)
        //{
        //    strKey = "Average all items";
        //    val=1;
        //}
        //else if (rbtRmaining.Checked)
        //{
        //    strKey = "Average remaining items";
        //    val=1;
        //}
        //else
        //{
        //    string js = "alert('Option not selected.');";
        //    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true);
        //    return ;
        //}

        if (rbtlstSettings.SelectedIndex == -1)
        {
            string js = "alert('Option not selected.');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true);
            return;
        }

        strKey = rbtlstSettings.SelectedValue;

        int ret = objBLL.INSERT_SlopChestSettings(strKey, val, UDFLib.ConvertIntegerToNull(Session["USERID"]));
    }
Exemple #11
0
    //protected void gvVoyageReport_PageIndexChanging(object sender, GridViewPageEventArgs e)
    //{
    //    gvVoyageReport.PageIndex = e.NewPageIndex;
    //    gvVoyageReport.DataBind();
    //}
    protected void ObjectDataSourcereport_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        e.InputParameters["reporttype"] = ViewState["sReportType"].ToString();;
        e.InputParameters["vesselid"]   = Convert.ToInt32(ViewState["iVesselID"].ToString());
        e.InputParameters["fleetid"]    = Convert.ToInt32(ViewState["iFleetID"].ToString());
        e.InputParameters["Page_Size"]  = UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CurrentPageIndex);
        e.InputParameters["Page_Size"]  = UDFLib.ConvertIntegerToNull(ucCustomPagerItems.PageSize);

        e.InputParameters["locationcode"] = Convert.ToInt32(ViewState["iLocationID"].ToString());
        if (ViewState["sFromDT"].ToString() == "")
        {
            e.InputParameters["fromdate"] = "1900/01/01";
        }
        else
        {
            e.InputParameters["fromdate"] = ViewState["sFromDT"].ToString();
        }
        if (ViewState["sToDT"].ToString() == "")
        {
            e.InputParameters["todate"] = "1900/01/01";
        }
        else
        {
            e.InputParameters["todate"] = ViewState["sToDT"].ToString();
        }
    }
    protected void BindCrewList()
    {
        DataSet ds = objPortCall.Get_PortCall_CrewChange(UDFLib.ConvertIntegerToNull(Request.QueryString["PCID"]));

        if (ds.Tables[0].Rows.Count > 0)
        {
            gvCrewOn.DataSource = ds.Tables[0];
            gvCrewOn.DataBind();
            lbl1.Visible  = true;
            lblOn.Visible = true;
        }
        else
        {
            lbl1.Visible  = false;
            lblOn.Visible = false;
        }
        if (ds.Tables[1].Rows.Count > 0)
        {
            gvCrewOff.DataSource = ds.Tables[1];
            gvCrewOff.DataBind();
            lbl1.Visible   = true;
            lblOff.Visible = true;
        }
        else
        {
            lbl1.Visible   = false;
            lblOff.Visible = false;
        }
    }
    public void BindFBMAccessRight()
    {
        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());
            }

            DataTable dt = BLL_FBM_Report.FBM_Get_RankList_Search(txtSearchBy.Text, UDFLib.ConvertIntegerToNull(ddlRank.SelectedValue), UDFLib.ConvertIntegerToNull(ddlRankCategory.SelectedValue)
                                                                  , sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);

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

            gvFBMAcessRight.DataSource = dt;
            gvFBMAcessRight.DataBind();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    protected void BindData()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        int?Finalized = null;

        if (ucCustomDropDownListstatus.SelectedValues.Rows.Count == 1)
        {
            Finalized = Convert.ToInt32(ucCustomDropDownListstatus.SelectedValues.Rows[0][0]);
        }

        DataTable dt = BLL_PURC_Common.Get_Bulk_Purchase_Reqsn((DataTable)Session["sFleet"], (DataTable)Session["sVesselCode"]
                                                               , UDFLib.ConvertStringToNull(Session["sDeptType"]), (DataTable)Session["sDeptCode"]
                                                               , UDFLib.ConvertIntegerToNull(Session["ReqsnType"].ToString()), UDFLib.ConvertStringToNull(Session["REQNUM"].ToString()), Finalized
                                                               , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);

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


        gvBulkPurchase.DataSource = dt;
        gvBulkPurchase.DataBind();


        if (ucCustomDropDownListstatus.SelectedValues.Rows.Count > 0)
        {
            (gvBulkPurchase.HeaderRow.FindControl("imgStatusFilter") as Image).ImageUrl = "../Images/filter-add-icon-green.png";
        }
        string script = " var height = document.body.scrollHeight;parent.ResizeFromChild(height,'1');";

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "resize" + DateTime.Now.Millisecond.ToString(), script, true);
    }
    protected void onUpdate(object source, CommandEventArgs e)
    {
        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            DepartmentData objDeptDo = new DepartmentData();
            HiddenFlag.Value = "Edit";

            OperationMode = "Edit PO Type";

            DataTable dtDept = new DataTable();
            dtDept = objTechService.Get_Req_POType(UDFLib.ConvertIntegerToNull(e.CommandArgument.ToString()));
            dtDept.DefaultView.RowFilter = "Id= '" + e.CommandArgument.ToString() + "'";

            ddlReqType.SelectedValue    = dtDept.DefaultView[0]["Reqsn_Type"].ToString();
            ddlPOType.SelectedValue     = dtDept.DefaultView[0]["PO_Type"].ToString();
            ddlBudgetCode.SelectedValue = dtDept.DefaultView[0]["Budget_Code"].ToString();
            ddlAccType.SelectedValue    = dtDept.DefaultView[0]["Account_Type"].ToString();
            txtBudgetID.Text            = dtDept.DefaultView[0]["ID"].ToString();
            objDeptDo.CurrentUser       = Session["userid"].ToString();



            string Deptmodal = String.Format("showModal('divadd',false);");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "POType", Deptmodal, true);
        }
    }
Exemple #16
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        int?AutoRefreshFlage = null;

        if (chkAutoRefresh_Add.Checked)
        {
            AutoRefreshFlage = 1;
        }

        if (HiddenFlag.Value == "Add")
        {
            int retval = BLL_Infra_DashBoard.Insert_DashBoardSnippet(txtSnippetID.Text, txtSnippetName.Text, txtSnippetFunctionName.Text
                                                                     , UDFLib.ConvertIntegerToNull(ddlDepartment_Add.SelectedValue), ddlDepartmentColor.SelectedValue, AutoRefreshFlage, Convert.ToInt32(Session["USERID"]));
        }
        else
        {
            int retval = BLL_Infra_DashBoard.Edit_DashBoardSnippet(Convert.ToInt32(txtID.Text.Trim()), txtSnippetID.Text, txtSnippetName.Text, txtSnippetFunctionName.Text
                                                                   , UDFLib.ConvertIntegerToNull(ddlDepartment_Add.SelectedValue), ddlDepartmentColor.SelectedValue, AutoRefreshFlage, Convert.ToInt32(Session["USERID"]));
        }

        BindDashBoardSnippet();

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

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
    }
    protected void Save_Click(object sender, EventArgs e)
    {
        using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase())
        {
            DepartmentData objDeptDo = new DepartmentData();

            //objDeptDo.DeptID = txtDeptID.Text;
            //objDeptDo.Dept_code = txtCode.Text;
            //objDeptDo.Dept_name = TxtDept.Text;
            //objDeptDo.FormType = cmbFType.SelectedValue;
            //objDeptDo.CurrentUser = Session["userid"].ToString();
            //objDeptDo.Ac_Clssification_Code = ddlAcClassification.SelectedValue;
            objDeptDo.Vessel_Code = "0";
            if (HiddenFlag.Value == "Add")
            {
                //int count = objTechService.SaveDepartment(objDeptDo);
                int count = objBLLDept.SavePOType(UDFLib.ConvertIntegerToNull(ddlReqType.SelectedValue), UDFLib.ConvertIntegerToNull(ddlBudgetCode.SelectedValue),
                                                  ddlPOType.SelectedValue, ddlAccType.SelectedValue, GetSessionUserID());
            }
            else
            {
                int count = objBLLDept.UpdatePOType(UDFLib.ConvertIntegerToNull(txtBudgetID.Text), UDFLib.ConvertIntegerToNull(ddlReqType.SelectedValue), UDFLib.ConvertIntegerToNull(ddlBudgetCode.SelectedValue),
                                                    ddlPOType.SelectedValue, ddlAccType.SelectedValue, GetSessionUserID());
            }

            BindrgdDept();

            string hidemodal = String.Format("hideModal('divadd')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
    }
Exemple #18
0
    /// <summary>
    /// Save access rights.
    /// </summary>
    private void SavePMS_Access()
    {
        try
        {
            if (HiddenFlag.Value == "Add")
            {
                objBLL.Insert_Update_Delete_PMS_Access(UDFLib.ConvertIntegerToNull(ddlRankName.SelectedValue), UDFLib.ConvertIntegerToNull(txtAccessID.Text), UDFLib.ConvertStringToNull(ddlActionType.SelectedValue),
                                                       Convert.ToInt32(Session["USERID"]), Convert.ToChar("A"));


                string jsSqlError2 = "alert('Access saved successfully.');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "jsSqlError2", jsSqlError2, true);
            }
            else
            {
                objBLL.Insert_Update_Delete_PMS_Access(UDFLib.ConvertIntegerToNull(ddlRankName.SelectedValue), UDFLib.ConvertIntegerToNull(txtAccessID.Text), UDFLib.ConvertStringToNull(ddlActionType.SelectedValue),
                                                       Convert.ToInt32(Session["USERID"]), Convert.ToChar("U"));

                string jsSqlError3 = "alert('Access updated successfully.');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "jsSqlError3", jsSqlError3, true);
            }

            BindPMS_Access();
            string hidemodal = String.Format("hideModal('divadd')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Exemple #19
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        int retval = 0;

        if (HiddenFlag.Value == "Add")
        {
            retval = objBLLOps.Insert_Hold_Tank(txtHoldTankName.Text, UDFLib.ConvertIntegerToNull(ddlStructureType.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue), Convert.ToInt32(Session["USERID"]));
        }
        else
        {
            retval = objBLLOps.Edit_Hold_Tank(Convert.ToInt32(txtHoldTankID.Text.Trim()), txtHoldTankName.Text, UDFLib.ConvertIntegerToNull(ddlStructureType.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue), Convert.ToInt32(Session["USERID"]));
        }
        if (retval > 0)
        {
            BindHoldTank();
        }
        else
        {
            string js = "";
            js = "alert('Vessel with same structure and same name already present. Please enter different name...');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "status", js, true);
        }
        string hidemodal = String.Format("hideModal('divadd')");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
    }
    public void BindGrid()
    {
        try
        {
            SetDefaultStatus();
            int rowcount = ucCustomPager1.isCountRecord;

            DataTable dtStatus = ChkStatus();

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


            DataTable dt = oBLL_CP.Get_Charter_Party_List_Search(UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), ddlSupplierList.SelectedValue,
                                                                 dtStatus, sortbycoloumn, sortdirection, ucCustomPager1.CurrentPageIndex, ucCustomPager1.PageSize, ref rowcount);


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

            //if (dt.Rows.Count > 0)
            //{
            gvCPList.DataSource = dt;
            gvCPList.DataBind();
            //}
        }
        catch { }
    }
    protected void imgbtnViewSectionDetails_Command(object sender, CommandEventArgs e)
    {
        txtProcedureSectionDetails.Visible = true;
        gvSectionList.SelectedIndex        = -1;
        gvSectionList.SelectedIndex        = ((sender as ImageButton).Parent.Parent as GridViewRow).RowIndex;

        if (UDFLib.ConvertIntegerToNull(e.CommandArgument) != null)
        {
            if (UDFLib.ConvertIntegerToNull(ViewState["Selected_Section_Details_ID"]) != null)
            {
                if (Is_Selected_Section_Details_Changed())
                {
                    Save_Section_Details();
                }
            }

            DataTable dt = BLL_QMSDB_ProcedureSection.Get_Section_Details(Convert.ToInt32(e.CommandArgument));
            if (dt.Rows.Count > 0)
            {
                txtProcedureSectionDetails.Content         = dt.Rows[0]["CHECKOUTDETAILS"].ToString();
                ViewState["Selected_Section_Details_Text"] = txtProcedureSectionDetails.Content;
                ViewState["Selected_Section_Details_ID"]   = e.CommandArgument;
            }
        }
    }
Exemple #22
0
 protected void BindApprovalLimitGrid()
 {
     try
     {
         DataSet ds = BLL_POLOG_Register.POLOG_Get_ApprovalDeatils(UDFLib.ConvertIntegerToNull(txtSupplyID.Text.ToString()));
         if (ds.Tables[1].Rows.Count > 0)
         {
             lblGroup.Text = ds.Tables[0].Rows[0]["Groupname"].ToString();
         }
         if (ds.Tables[0].Rows.Count > 0)
         {
             lblverifier.Text = ds.Tables[1].Rows[0]["Verifier"].ToString();
         }
         if (ds.Tables[2].Rows.Count > 0)
         {
             gvApprovalLimit.DataSource = ds.Tables[2];
             gvApprovalLimit.DataBind();
         }
         else
         {
             gvApprovalLimit.DataSource = null;
             gvApprovalLimit.DataBind();
         }
     }
     catch { }
     {
     }
 }
    protected void btnCompanyUpload_Click(object sender, EventArgs e)
    {
        try
        {
            if (File_CompanyUpload.FileName != "")
            {
                string strLocalPath  = File_CompanyUpload.PostedFile.FileName;
                string FileName      = Path.GetFileName(strLocalPath);
                string FileExtension = Path.GetExtension(strLocalPath);
                string TYPE          = "00002";
                string DocType       = "SUPPLIER";
                Guid   FileGuid      = System.Guid.NewGuid();
                string path          = Server.MapPath(@"~/Uploads\\ASL\\");
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                File_CompanyUpload.PostedFile.SaveAs(Server.MapPath(@"~/Uploads\\ASL\\" + FileGuid + FileExtension));
                string Supplier_Code = UDFLib.ConvertStringToNull(GetSuppID());


                BLL_ASL_Supplier.Supplier_Attachment_Insert(UDFLib.ConvertStringToNull(GetSuppID()), FileName, FileGuid + FileExtension, FileExtension
                                                            , UDFLib.ConvertIntegerToNull(Session["userid"]), TYPE, DocType);

                BindAttachment();
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Exemple #24
0
    protected void BindItems()
    {
        try
        {
            int       Record_Count = 0;
            DataTable dt           = BLL_PB_PortageBill.Get_Lib_Crew_Welfare(UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertDateToNull(ddlEectiveDates.SelectedValue), pagerWf.CurrentPageIndex, pagerWf.PageSize, ref Record_Count);
            UDFLib.ChangeColumnDataType(dt, "Effective_Date", typeof(string));
            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (!string.IsNullOrEmpty(dr["Effective_Date"].ToString()))
                    {
                        dr["Effective_Date"] = UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Effective_Date"].ToString()), UDFLib.GetDateFormat());
                    }
                }
            }
            gvWelfare.DataSource = dt;
            gvWelfare.DataBind();

            pagerWf.CountTotalRec = Record_Count.ToString();
            pagerWf.BuildPager();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Exemple #25
0
 private void BindItems()
 {
     try
     {
         DataTable dt = objCP.GET_Trading_Period(UDFLib.ConvertIntegerToNull(ViewState["CPID"]));
         if (dt.Rows.Count > 0)
         {
             dtGridItems         = dt;
             rgdItems.DataSource = dt;
             rgdItems.DataBind();
             //rgdItems.ShowFooter = false;
         }
         else
         {
             dtGridItems         = GetAddTable();
             rgdItems.DataSource = dtGridItems;
             rgdItems.DataBind();
             // rgdItems.MasterTableView.Columns[8].Visible = false;
             //rgdItems.MasterTableView.Columns[9].Visible = false;
         }
         ViewState["dtGridItems"] = dtGridItems;
     }
     catch (Exception ex)
     {
         lblError.Text = ex.ToString();
         //.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex);
     }
     finally
     {
     }
 }
Exemple #26
0
    protected void tvItemList_SelectedNodeChanged(object sender, EventArgs e)
    {
        BLL_PMS_Library_Jobs objJobs = new BLL_PMS_Library_Jobs();

        gvJobs.DataSource = null;
        gvJobs.DataBind();


        if (((TreeView)(sender)).SelectedNode.Depth == 1 || ((TreeView)(sender)).SelectedNode.Depth == 3)
        {
            int     rowcount = 0;
            DataSet ds       = objJobs.LibraryJobSearch(UDFLib.ConvertIntegerToNull(tvItemList.SelectedValue.Split(',')[0]), UDFLib.ConvertIntegerToNull(tvItemList.SelectedValue.Split(',')[1]), UDFLib.ConvertToInteger(DDLVessel.SelectedValue), null, null, null
                                                        , 1, "id"
                                                        , 1, 1, 200, ref rowcount);


            gvJobs.DataSource = ds.Tables[0];
            gvJobs.DataBind();
        }

        if (((TreeView)(sender)).SelectedNode.Depth == 0)
        {
            Function_Click((sender as TreeView).SelectedNode);
        }
    }
Exemple #27
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Repeater fvDetails = (Repeater)FormView1.Row.Cells[0].FindControl("Repeater1");

        foreach (RepeaterItem ritem in fvDetails.Items)
        {
            Label   lblid     = (Label)ritem.FindControl("lblid");
            Label   lblVessel = (Label)ritem.FindControl("lblVessel");
            TextBox tx1       = (TextBox)ritem.FindControl("txtCYL_OIL_DAY_TK");
            TextBox tx2       = (TextBox)ritem.FindControl("txtME_SUMP");
            TextBox tx3       = (TextBox)ritem.FindControl("txtHEAVY_OIL_SETTL_TK");
            TextBox tx4       = (TextBox)ritem.FindControl("txtHEAVY_OIL_SERV_TK");
            TextBox tx5       = (TextBox)ritem.FindControl("txtBELENDED_OIL");
            TextBox tx6       = (TextBox)ritem.FindControl("txtDO_SERV_TK");
            TextBox tx01      = (TextBox)ritem.FindControl("txtCYL_OIL_DAY_TK_Max");
            TextBox tx02      = (TextBox)ritem.FindControl("txtME_SUMP_Max");
            TextBox tx03      = (TextBox)ritem.FindControl("txtHEAVY_OIL_SETTL_TK_Max");
            TextBox tx04      = (TextBox)ritem.FindControl("txtHEAVY_OIL_SERV_TK_Max");
            TextBox tx05      = (TextBox)ritem.FindControl("txtBELENDED_OIL_Max");
            TextBox tx06      = (TextBox)ritem.FindControl("txtDO_SERV_TK_Max");
            bool    valstatus = true;
            if ((UDFLib.ConvertDecimalToNull(tx1.Text) != null) && (UDFLib.ConvertDecimalToNull(tx01.Text) != null) && (decimal.Parse(tx1.Text) > decimal.Parse(tx01.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx2.Text) != null) && (UDFLib.ConvertDecimalToNull(tx02.Text) != null) && (decimal.Parse(tx2.Text) > decimal.Parse(tx02.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx3.Text) != null) && (UDFLib.ConvertDecimalToNull(tx03.Text) != null) && (decimal.Parse(tx3.Text) > decimal.Parse(tx03.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx4.Text) != null) && (UDFLib.ConvertDecimalToNull(tx04.Text) != null) && (decimal.Parse(tx4.Text) > decimal.Parse(tx04.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx5.Text) != null) && (UDFLib.ConvertDecimalToNull(tx05.Text) != null) && (decimal.Parse(tx5.Text) > decimal.Parse(tx05.Text)))
            {
                valstatus = false;
            }
            if ((UDFLib.ConvertDecimalToNull(tx6.Text) != null) && (UDFLib.ConvertDecimalToNull(tx06.Text) != null) && (decimal.Parse(tx6.Text) > decimal.Parse(tx06.Text)))
            {
                valstatus = false;
            }
            if (valstatus)
            {
                int i = BLL_Tec_ErLog.ErLog_TANK_LEVELS_THRESHOLD_Update(UDFLib.ConvertIntegerToNull(lblid.Text), UDFLib.ConvertIntegerToNull(ViewState["VESSELID"].ToString()), UDFLib.ConvertDecimalToNull(tx1.Text), UDFLib.ConvertDecimalToNull(tx2.Text),
                                                                         UDFLib.ConvertDecimalToNull(tx3.Text), UDFLib.ConvertDecimalToNull(tx4.Text), UDFLib.ConvertDecimalToNull(tx5.Text), UDFLib.ConvertDecimalToNull(tx6.Text), UDFLib.ConvertDecimalToNull(tx01.Text),
                                                                         UDFLib.ConvertDecimalToNull(tx02.Text), UDFLib.ConvertDecimalToNull(tx03.Text), UDFLib.ConvertDecimalToNull(tx04.Text), UDFLib.ConvertDecimalToNull(tx05.Text), UDFLib.ConvertDecimalToNull(tx06.Text), Convert.ToInt32(Session["USERID"]));
                string js = "alert('Changes are updated ');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
            }
            else
            {
                string js = "alert('Please check your data');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true);
            }
        }
    }
    public void BindrgdDept()
    {
        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 = objBLLDept.POType_Search(UDFLib.ConvertIntegerToNull(ddlFilterType.SelectedValue), sortbycoloumn, sortdirection
                                                , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


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


        if (dt.Rows.Count > 0)
        {
            rgdDept.DataSource = dt;
            rgdDept.DataBind();
        }
        else
        {
            rgdDept.DataSource = dt;
            rgdDept.DataBind();
        }
    }
    protected void btnNewChapter_Click(object sender, EventArgs e)
    {
        if (UDFLib.ConvertToInteger(txtDuration.Text) <= 0 && UDFLib.ConvertIntegerToNull(ddlProgramCategory.SelectedValue) != 4)
        {
            string msgmodal = String.Format("alertm('dur')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", msgmodal, true);
            return;
        }

        if (UDFLib.ConvertToInteger(hdfProgram_Id.Value) == 0)
        {
            string lProgramType = "VESSELTRAINING";
            if (rdbVideo.Checked)
            {
                lProgramType = "JIBETRAINING";
            }

            hdfProgramCategory.Value = ddlProgramCategory.SelectedValue;
            hdfProgram_Id.Value      = BLL_LMS_Training.Ins_Program_Details(null, UDFLib.ConvertIntegerToNull(ddlProgramCategory.SelectedValue), txtProgramName.Text.Trim(), txtProgramDescription.Text.Trim(), UDFLib.ConvertIntegerToNull(txtDuration.Text.Trim()), lProgramType, Convert.ToInt32(Session["USERID"]), 1).ToString();
        }

        String msgretv = String.Format("OpenPopupWindowBtnID('POP__ChapterDetails', 'Chapter Details','LMS_Chapter_Details.aspx?Chapter_ID=&Program_ID=" + hdfProgram_Id.Value + "&ProgramCategory=" + UDFLib.ConvertIntegerToNull(ddlProgramCategory.SelectedValue) + "', 'popup', 840, 1000, null, null, false, false, true, false,'" + btnSearch.ClientID + "')");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgret6v", msgretv, true);
    }
Exemple #30
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         DataTable dtQuest = new DataTable();
         dtQuest.Columns.Add("QUESTION_ID");
         dtQuest.Columns.Add("OPTIONS_ID");
         DataRow dr = null;
         foreach (GridViewRow gridRow in grdQuestion.Rows)
         {
             Label        lblQID = (Label)gridRow.FindControl("lblQuestID");
             DropDownList ddl    = (DropDownList)gridRow.FindControl("ddlAnswers");
             TextBox      txtc   = (TextBox)gridRow.FindControl("txtDescriptive");
             if (ddl.SelectedValue != "")
             {
                 dr = dtQuest.NewRow();
                 dr["QUESTION_ID"] = UDFLib.ConvertIntegerToNull(lblQID.Text);
                 dr["OPTIONS_ID"]  = UDFLib.ConvertIntegerToNull(ddl.SelectedValue);
                 dtQuest.Rows.Add(dr);
             }
         }
         int retval = objTechService.Insert_Purc_Question("", Convert.ToString(Request.QueryString["DocumentCode"]), Convert.ToInt32(Session["userid"]), dtQuest, 0, 0);
         if (retval == 1)
         {
             string message1 = "alert('Questions Added succesfully..');";
             ScriptManager.RegisterStartupScript(this, this.GetType(), "requisition", message1, true);
         }
     }
     catch
     {
     }
 }