Exemplo n.º 1
0
 //Delete
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         int    RetValue = BLL_ASL_Supplier.Evaluation_Data_Delete(UDFLib.ConvertIntegerToNull(ViewState["ReturnEvalutionID"].ToString()), UDFLib.ConvertStringToNull(Request.QueryString["Supp_ID"].ToString()), UDFLib.ConvertToInteger(GetSessionUserID()));
         string message  = "alert('Evaluation Record Deleted.')";
         ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
         //BindSupplier();
         string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// Method is used to insert/update observation note details
 /// </summary>
 /// <param name="Mode">Mode of operation. Value is Add or Edit</param>
 public void VET_Ins_Observation_Note(string Mode)
 {
     try
     {
         BLL_VET_Index objBLLIndx = new BLL_VET_Index();
         if (Mode == "Add")
         {
             DataTable dtObservation = new DataTable();
             dtObservation = objBLLIndx.VET_Ins_Observation_Note(UDFLib.ConvertToInteger(ViewState["Vetting_ID"].ToString()), UDFLib.ConvertToInteger(ddlQuestion.SelectedValue), UDFLib.ConvertToInteger(ddlType.SelectedValue), txtObsDescription.Text.Trim(), UDFLib.ConvertToInteger(ddlCategory.SelectedValue), UDFLib.ConvertIntegerToNull(ddlRiskLevel.SelectedValue), ddlStatus.SelectedItem.Text.Trim(), UDFLib.ConvertToInteger(Session["USERID"].ToString()));
             if (dtObservation.Rows.Count > 0)
             {
                 hdnObservationId.Value       = dtObservation.Rows[0]["Observation_ID"].ToString();
                 hdnQryStrObservationId.Value = dtObservation.Rows[0]["Observation_ID"].ToString();
                 ViewState["Observation_ID"]  = hdnObservationId.Value;
             }
             string jsSqlError2 = "alert('Observation saved successfully.');";
             ScriptManager.RegisterStartupScript(this, this.GetType(), "jsSqlError2", jsSqlError2, true);
         }
         else if (Mode == "Edit")
         {
             objBLLIndx.VET_Upd_Observation_Note(UDFLib.ConvertToInteger(ViewState["Observation_ID"].ToString()), UDFLib.ConvertToInteger(ViewState["Vetting_ID"].ToString()), UDFLib.ConvertToInteger(ddlQuestion.SelectedValue), UDFLib.ConvertToInteger(ddlType.SelectedValue), txtObsDescription.Text.Trim(), UDFLib.ConvertToInteger(ddlCategory.SelectedValue), UDFLib.ConvertIntegerToNull(ddlRiskLevel.SelectedValue), ddlStatus.SelectedItem.Text.Trim(), UDFLib.ConvertToInteger(Session["USERID"].ToString()));
             string jsSqlError2 = "alert('Observation updated successfully.');";
             ScriptManager.RegisterStartupScript(this, this.GetType(), "jsSqlError2", jsSqlError2, true);
         }
     }
     catch (Exception ex)
     {
         UDFLib.WriteExceptionLog(ex);
         string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
         ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
     }
 }
 protected void gvRelatedJob_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         BLL_VET_Index objBLLIndx = new BLL_VET_Index();
         int           OBSJobID   = UDFLib.ConvertToInteger(e.CommandArgument.ToString());
         int           res        = objBLLIndx.VET_Upd_UnlinkWorklistJobs(OBSJobID, UDFLib.ConvertToInteger(Session["USERID"].ToString()));
         VET_Get_ObsRelatedJobs();
     }
     catch (Exception ex)
     {
         UDFLib.WriteExceptionLog(ex);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                ViewState["FleetCode"]         = "";
                ViewState["Vessel_ID"]         = "";
                ViewState["Vetting_ID"]        = "";
                ViewState["Question_ID"]       = "";
                ViewState["Observation_ID"]    = "";
                ViewState["Vessel_Name"]       = "";
                ViewState["Vetting_Type_ID"]   = "";
                ViewState["Vetting_Type_Name"] = "";
                ViewState["Mode"] = "";


                if (Request.QueryString["FleetCode"] != null)
                {
                    FleetCode = Request.QueryString["FleetCode"].ToString();
                    ViewState["FleetCode"] = Request.QueryString["FleetCode"].ToString();
                }
                if (Request.QueryString["Vessel_ID"] != null)
                {
                    Vessel_ID = Request.QueryString["Vessel_ID"].ToString();
                    ViewState["Vessel_ID"] = Request.QueryString["Vessel_ID"].ToString();
                }
                if (Request.QueryString["Vessel_Name"] != null)
                {
                    Vessel_Name = Request.QueryString["Vessel_Name"].ToString();
                    ViewState["Vessel_Name"] = Request.QueryString["Vessel_Name"].ToString();
                }
                if (Request.QueryString["Vetting_Type_ID"] != null)
                {
                    Vetting_Type_ID = Request.QueryString["Vetting_Type_ID"].ToString();
                    ViewState["Vetting_Type_ID"] = Request.QueryString["Vetting_Type_ID"].ToString();
                }
                if (Request.QueryString["Vetting_Type_Name"] != null)
                {
                    Vetting_Type_Name = Request.QueryString["Vetting_Type_Name"].ToString();
                    ViewState["Vetting_Type_Name"] = Request.QueryString["Vetting_Type_Name"].ToString();
                }
                if (Request.QueryString["Vetting_ID"] != null)
                {
                    Vetting_ID = Request.QueryString["Vetting_ID"].ToString();
                    ViewState["Vetting_ID"] = Request.QueryString["Vetting_ID"].ToString();
                }
                if (Request.QueryString["Question_ID"] != null)
                {
                    Question_ID = Request.QueryString["Question_ID"].ToString();
                    ViewState["Question_ID"] = Request.QueryString["Question_ID"].ToString();
                }
                if (Request.QueryString["Observation_ID"] != null)
                {
                    Observation_ID = Request.QueryString["Observation_ID"].ToString();
                    hdnQryStrObservationId.Value = Observation_ID;
                    ViewState["Observation_ID"]  = Request.QueryString["Observation_ID"].ToString();
                    Mode = "Edit";
                }
                if (!string.IsNullOrWhiteSpace(Convert.ToString(Request.QueryString["Mode"])))
                {
                    Mode = Request.QueryString["Mode"].ToString();
                    ViewState["Mode"] = Request.QueryString["Mode"].ToString();
                }
                if (!string.IsNullOrWhiteSpace(Convert.ToString(Request.QueryString["Vetting_Status"])))
                {
                    Vetting_Status = Request.QueryString["Vetting_Status"].ToString();
                }
                if (!string.IsNullOrWhiteSpace(Convert.ToString(Request.QueryString["Opn_Obs_Count"])))
                {
                    ViewState["Opn_Obs_Count"] = Request.QueryString["Opn_Obs_Count"].ToString();
                    lnkRelatedObs.Text         = ViewState["Opn_Obs_Count"].ToString();
                    lnkRelatedObs.NavigateUrl  = "Vetting_ObservationIndex.aspx?Question_ID=" + Question_ID + "&FleetCode=" + FleetCode + "&Vetting_Type_ID=" + Vetting_Type_ID + "&Status=Open" + "&Parent=AON";

                    if (lnkRelatedObs.Text == "0")
                    {
                        lnkRelatedObs.Enabled = false;
                    }
                }
                VET_Get_SectionListByVettingId();
                VET_Get_QuestionNoByVettingId();
                VET_Get_ObservationCategories();
                VET_Get_ObservationTypeList();
                if (Mode == "Add")
                {
                    txtObsDescription.Enabled = true;
                    ImgUpdate.Enabled         = false;
                    ImgAddNewJob.Enabled      = false;
                    ImglnkJob.Enabled         = false;
                    ImgAddResponse.Enabled    = false;
                    dvbadge.Visible           = false;
                }
                if (Mode == "Edit")
                {
                    VET_Get_Observation();
                    //ImgAddNewJob.NavigateUrl = "../Worklist/AddNewJob.aspx?VID=" + ViewState["Vessel_ID"].ToString() + "&Vetting_ID=" + ViewState["Vetting_ID"].ToString() + "&Question_ID=" + ddlQuestion.SelectedValue + "&Observation_ID=" + ViewState["Observation_ID"].ToString() + "&WLID=0&OFFID=0";
                    //enable the edit button in read-only mode to view observation
                    if (Vetting_Status == "Completed")
                    {
                        ImgAddNewJob.Enabled   = false;
                        ImglnkJob.Enabled      = false;
                        ImgAddResponse.Enabled = false;
                        btnSave.Enabled        = false;
                        BtnSaveClose.Enabled   = false;
                        ImgAddResponse.Enabled = false;
                        ImgUpdate.Enabled      = false;
                    }
                    else
                    {
                        ImgAddNewJob.Enabled   = true;
                        ImglnkJob.Enabled      = true;
                        ImgAddResponse.Enabled = true;
                    }
                    dvbadge.Visible = true;
                    ImglnkJob.Attributes.Add("onClick", "PopupAssignJob(" + Observation_ID + "," + Vessel_ID + ")");
                    UpdPnlAddObservation_Naote.Update();
                }

                VET_Get_Response();
                VET_Get_ObsRelatedJobs();
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    /// <summary>
    /// Method is used to get observation details for display
    /// </summary>
    public void VET_Get_Observation()
    {
        try
        {
            BLL_VET_Index objBLLIndx = new BLL_VET_Index();
            DataTable     dtObs      = objBLLIndx.VET_Get_Observation(UDFLib.ConvertToInteger(ViewState["Vetting_ID"].ToString()), UDFLib.ConvertToInteger(ViewState["Question_ID"].ToString()), UDFLib.ConvertToInteger(ViewState["Observation_ID"].ToString()));

            if (dtObs.Rows.Count > 0)
            {
                if (Convert.ToString(dtObs.Rows[0]["Section_No"]) != "")
                {
                    ddlSection.ClearSelection();
                    ddlSection.Items.FindByText(Convert.ToString(dtObs.Rows[0]["Section_No"])).Selected = true;
                }
                if (Convert.ToString(dtObs.Rows[0]["Question_No"]) != "")
                {
                    VET_Get_QuestionByVettingId_SectionNo();
                    ddlQuestion.ClearSelection();
                    ddlQuestion.Items.FindByText(Convert.ToString(dtObs.Rows[0]["Question_No"])).Selected = true;
                }
                if (Convert.ToString(dtObs.Rows[0]["Category"]) != "")
                {
                    ddlCategory.ClearSelection();
                    ddlCategory.Items.FindByText(Convert.ToString(dtObs.Rows[0]["Category"])).Selected = true;
                }
                if (Convert.ToString(dtObs.Rows[0]["Risk_Level"]) != "")
                {
                    ddlRiskLevel.ClearSelection();
                    ddlRiskLevel.Items.FindByText(Convert.ToString(dtObs.Rows[0]["Risk_Level"])).Selected = true;
                }
                if (Convert.ToString(dtObs.Rows[0]["Status"]) != "")
                {
                    ddlStatus.ClearSelection();
                    ddlStatus.Items.FindByText(Convert.ToString(dtObs.Rows[0]["Status"])).Selected = true;
                }
                if (Convert.ToString(dtObs.Rows[0]["ObsType"]) != "")
                {
                    ddlType.ClearSelection();
                    ddlType.Items.FindByText(Convert.ToString(dtObs.Rows[0]["ObsType"])).Selected = true;
                }
                if (Convert.ToString(dtObs.Rows[0]["ObsDescription"]) != "")
                {
                    txtObsDescription.Text = dtObs.Rows[0]["ObsDescription"].ToString();
                }
                if (Convert.ToString(dtObs.Rows[0]["Question"]) != "")
                {
                    lblQuestion.Text = dtObs.Rows[0]["Question"].ToString();
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
            string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
        }
    }
Exemplo n.º 6
0
    public void BindUserApproval()
    {
        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 = objBLLAppLimit.Get_Approval_Limit_Search(txtfilter.Text != "" ? txtfilter.Text : null, UDFLib.ConvertIntegerToNull(DDLGroupFilter.SelectedValue)
                                                                , UDFLib.ConvertIntegerToNull(DDLUserFilter.SelectedValue), sortbycoloumn, sortdirection
                                                                , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


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

        gvUserType.DataSource = dt;
        gvUserType.DataBind();
    }
Exemplo n.º 7
0
    protected void gvVoyageReport_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            try
            {
                string TelegramType    = DataBinder.Eval(e.Row.DataItem, "TELEGRAM_TYPE").ToString();
                string wind            = DataBinder.Eval(e.Row.DataItem, "WIND_FORCE").ToString();
                string instructedspeed = DataBinder.Eval(e.Row.DataItem, "INSTRUCTED_SPEED").ToString();
                string averagespeed    = DataBinder.Eval(e.Row.DataItem, "AVERAGE_SPEED").ToString();
                string stractualHO     = DataBinder.Eval(e.Row.DataItem, "ACTUAL_HO_CONSMP").ToString();
                string stractualDO     = DataBinder.Eval(e.Row.DataItem, "ACTUAL_DO_CONSMP").ToString();
                string strcpHO         = DataBinder.Eval(e.Row.DataItem, "CP_HOCONS").ToString();
                string strcpDO         = DataBinder.Eval(e.Row.DataItem, "CP_DOCONS").ToString();
                string strVesselID     = DataBinder.Eval(e.Row.DataItem, "Vessel_ID").ToString();

                #region Format cells
                if (TelegramType.ToUpper() == "N")
                {
                    e.Row.Cells[3].BackColor = System.Drawing.Color.Yellow;
                }
                else if (TelegramType.ToUpper() == "D")
                {
                    e.Row.Cells[3].BackColor = System.Drawing.Color.Orange;
                }
                else if (TelegramType.ToUpper() == "A")
                {
                    e.Row.Cells[3].BackColor = System.Drawing.Color.YellowGreen;
                }
                else if (TelegramType.ToUpper() == "P")
                {
                    e.Row.Cells[3].CssClass  = "PurpleFinder-css";
                    e.Row.Cells[3].ForeColor = System.Drawing.Color.Black;
                }

                double WindForce = 0.0;
                if (double.TryParse(wind, out WindForce))
                {
                    if (WindForce >= 5)
                    {
                        e.Row.Cells[8].CssClass = "RedCell";
                    }
                }

                double AvgSpeed = 0.0;
                double InsSpeed = 0.0;

                if (double.TryParse(averagespeed, out AvgSpeed) && double.TryParse(instructedspeed, out InsSpeed))
                {
                    if (AvgSpeed < InsSpeed)
                    {
                        e.Row.Cells[10].CssClass = "RedCell";
                    }
                }

                double ActualHO = 0.0;
                double CPHO     = 0.0;

                if (double.TryParse(stractualHO, out ActualHO) && double.TryParse(strcpHO, out CPHO))
                {
                    if (ActualHO > CPHO)
                    {
                        e.Row.Cells[12].CssClass = "RedCell";
                    }
                }


                double ActualDO = 0.0;
                double CPDO     = 0.0;

                if (double.TryParse(stractualDO, out ActualDO) && double.TryParse(strcpDO, out CPDO))
                {
                    if (ActualDO > CPDO)
                    {
                        e.Row.Cells[14].CssClass = "RedCell";
                    }
                }

                #endregion

                string strRowId = DataBinder.Eval(e.Row.DataItem, "pkid").ToString();

                string strtype = DataBinder.Eval(e.Row.DataItem, "Telegram_Type").ToString();

                for (int ix = 1; ix < e.Row.Cells.Count - 1; ix++)
                {
                    string filters = Convert.ToString(ViewState["sReportType"]) + "~" + Convert.ToString(ViewState["iVesselID"]) + "~" + Convert.ToString(ViewState["iLocationID"]) + "~" + Convert.ToString(ViewState["sFromDT"]) + "~" + Convert.ToString(ViewState["sToDT"]) + "~" + Convert.ToString(ViewState["iFleetID"]);

                    e.Row.Cells[ix].Attributes.Add("onclick", "showdetails('" + strRowId.Split(new char[] { '.' })[0] + "," + strtype + "," + filters + "')");

                    e.Row.Cells[ix].Attributes.Add("style", "cursor:pointer");
                }

                #region check for low ROB

                bool stsLow = false;

                string strCPFlt  = "Vessel_ID=" + strVesselID + " AND datatype like '%ROB%'";
                string strVSLflt = "Vessel_ID=" + strVesselID + " AND pkid=" + strRowId;


                DataRow[] drVSLROB = dtVesselROB.Select(strVSLflt);
                DataRow[] drCPROB  = dtCPROB.Select(strCPFlt);

                foreach (DataRow dr in drCPROB)
                {
                    string  DataCode  = dr["Data_Code"].ToString().ToUpper().Trim();
                    decimal datavalue = decimal.Parse(dr["data_value"].ToString());

                    if (DataCode == "HO_ROB")
                    {
                        if (decimal.Parse(drVSLROB[0]["HO_ROB"].ToString()) < datavalue)
                        {
                            stsLow = true;
                            break;
                        }
                    }
                    else if (DataCode == "DO_ROB")
                    {
                        if (decimal.Parse(drVSLROB[0]["DO_ROB"].ToString()) < datavalue)
                        {
                            stsLow = true;
                            break;
                        }
                    }

                    else if (DataCode == "AECC_ROB")
                    {
                        if (decimal.Parse(drVSLROB[0]["AECC_ROB"].ToString()) < datavalue)
                        {
                            stsLow = true;
                            break;
                        }
                    }
                    else if (DataCode == "MECC_ROB")
                    {
                        if (decimal.Parse(drVSLROB[0]["MECC_ROB"].ToString()) < datavalue)
                        {
                            stsLow = true;
                            break;
                        }
                    }

                    else if (DataCode == "MECYL_ROB")
                    {
                        if (decimal.Parse(drVSLROB[0]["MECYL_ROB"].ToString()) < datavalue)
                        {
                            stsLow = true;
                            break;
                        }
                    }
                    else if (DataCode == "FW_ROB")
                    {
                        if (decimal.Parse(drVSLROB[0]["FW_ROB"].ToString()) < datavalue)
                        {
                            stsLow = true;
                            break;
                        }
                    }
                }

                if (stsLow == true)
                {
                    ((Label)e.Row.Cells[16].FindControl("lblLowrob")).Text = "YES";
                    //((Label)e.Row.Cells[14].FindControl("lblLowrob")).CssClass = "RedCell";
                    e.Row.Cells[16].CssClass = "RedCell";
                }

                #endregion

                #region check for FW Cons

                if (TelegramType.ToUpper() == "N")
                {
                    decimal FWCons = UDFLib.ConvertToDecimal(DataBinder.Eval(e.Row.DataItem, "FW_CONS").ToString());

                    decimal FWCPCons = UDFLib.ConvertToDecimal(DataBinder.Eval(e.Row.DataItem, "CP_FWCONS").ToString());

                    if (FWCPCons < FWCons)
                    {
                        e.Row.Cells[15].CssClass = "RedCell";
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
            }
        }
    }
Exemplo n.º 8
0
    public void BindAgentBank()
    {
        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 = objBLL.Agent_Bank_Account_Search(txtfilter.Text != "" ? txtfilter.Text : null, UDFLib.ConvertIntegerToNull(ddlCurrencyFilter.SelectedValue), UDFLib.ConvertIntegerToNull(ddlManningOfficeFilter.SelectedValue),
                                                        sortbycoloumn, sortdirection
                                                        , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


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

        if (dt.Rows.Count > 0)
        {
            gvAgentBank.DataSource = dt;
            gvAgentBank.DataBind();
        }
        else
        {
            gvAgentBank.DataSource = dt;
            gvAgentBank.DataBind();
        }
    }
Exemplo n.º 9
0
    protected void cmdUpload_Click(object source, EventArgs e)
    {
        BLL_TRV_Attachment att = new BLL_TRV_Attachment();

        try
        {
            if (IsPostBack)
            {
                if (Attach_Type.ToString().ToUpper() == "INVOICE")
                {
                    SaveInvoice();
                    ddlAttachmentType.SelectedIndex = 0;
                    txtInvAmount.Text = "";
                    txtInvNo.Text     = "";
                }

                if (flName.PostedFile.ContentLength > 0)
                {
                    string sFileName, filePath;

                    sFileName = System.Guid.NewGuid().ToString() + Path.GetExtension(flName.PostedFile.FileName);

                    filePath = ConfigurationManager.AppSettings["TRV_UPLOAD_PATH"].ToString();
                    if (flName.PostedFile.ContentLength <= 3048000)
                    {
                        filePath = Server.MapPath("~/") + ConfigurationManager.AppSettings["TRV_UPLOAD_PATH"].ToString() + sFileName;
                        flName.PostedFile.SaveAs(filePath);

                        att.SaveAttchement(RequestID, Path.GetFileName(flName.PostedFile.FileName), sFileName, Attach_Type, "",
                                           Convert.ToInt32(Session["USERID"].ToString()), UDFLib.ConvertIntegerToNull(Request.QueryString["SUPPLIER_ID"]));
                    }
                }
            }
            GetAttachment(RequestID, Attach_Type);
        }
        catch (UnauthorizedAccessException ex) { throw new Exception(ex.Message + "Permission to upload file denied"); }
        finally { att = null; }
    }
Exemplo n.º 10
0
    protected void SaveSupplierPort()
    {
        DataTable dtService = new DataTable();

        dtService.Columns.Add("PKID");
        dtService.Columns.Add("FKID");
        dtService.Columns.Add("Value");
        foreach (ListItem chkitem in chkPort.Items)
        {
            DataRow dr = dtService.NewRow();
            dr["FKID"]  = chkitem.Value;
            dr["Value"] = chkitem.Selected == true ? 1 : 0;
            dtService.Rows.Add(dr);
        }
        BLL_ASL_Supplier.ASL_Supplier_Port_Insert(UDFLib.ConvertStringToNull(UDFLib.ConvertStringToNull(Request.QueryString["Supp_ID"].ToString())), dtService, UDFLib.ConvertToInteger(GetSessionUserID()));
    }
Exemplo n.º 11
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 = objBLL.Agent_Bank_Account_Search(txtfilter.Text != "" ? txtfilter.Text : null, UDFLib.ConvertIntegerToNull(ddlCurrencyFilter.SelectedValue),
                                                        UDFLib.ConvertIntegerToNull(ddlManningOfficeFilter.SelectedValue)
                                                        , sortbycoloumn, sortdirection, null, null, ref rowcount);



        string[] HeaderCaptions  = { "Manning Office", "Beneficiary", "A/c No.", "Bank Currency", "Swift Code", "Bank Code", "Branch Code", "Bank Address" };
        string[] DataColumnsName = { "COMPANY_NAME", "Beneficiary", "Acc_NO", "Currency_Code", "SwiftCode", "BANK_CODE", "BRANCH_CODE", "Bank_Address" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "AgentBankAccount", "Agent Bank Account");
    }
Exemplo n.º 12
0
 //Send Mail
 protected void SendEmail(string Evaluationstatus, string Approve, string Reject)
 {
     try
     {
         int RetValue = BLL_ASL_Supplier.Evaluation_Send_Email(UDFLib.ConvertIntegerToNull(ViewState["ReturnEvalutionID"].ToString()), UDFLib.ConvertStringToNull(GetSuppID()), Evaluationstatus,
                                                               UDFLib.ConvertIntegerToNull(GetSessionUserID()), Approve, Reject);
     }
     catch (Exception ex)
     {
         UDFLib.WriteExceptionLog(ex);
     }
 }
Exemplo n.º 13
0
    //Final Approval Funcation
    protected void SaveFinalEvaluation(string EvaluationStatus, string Approve, string Reject)
    {
        try
        {
            string str1 = "";
            if (chkUrgent.Checked == true)
            {
                str1 = "Yes";
            }
            else
            {
                str1 = "No";
            }

            int RetValue = BLL_ASL_Supplier.Evaluation_Data_Insert(UDFLib.ConvertIntegerToNull(ViewState["ReturnEvalutionID"].ToString())
                                                                   , UDFLib.ConvertStringToNull(GetSuppID()), EvaluationStatus, UDFLib.ConvertStringToNull(ddlProposedStatus.SelectedItem),
                                                                   UDFLib.ConvertIntegerToNull(ddlforPeriod.SelectedValue), txtRemarks.Text, txtVerificationRemrks.Text, txtApprovalRemrks.Text,
                                                                   UDFLib.ConvertToInteger(GetSessionUserID()), UDFLib.ConvertToInteger(ddlApproverName.SelectedValue), UDFLib.ConvertToInteger(ddlFinalApproverName.SelectedValue), str1, Approve, Reject, txtSupplierDesc.Text.Trim());

            ViewState["ReturnEvalutionID"] = RetValue;
            SaveSupplierScope();
            SaveSupplierPort();
        }
        catch { }
        {
        }
    }
Exemplo n.º 14
0
    protected void BindSupplier()
    {
        try
        {
            int?   EvalID  = UDFLib.ConvertIntegerToNull(GetEvaluation_ID());
            string Supp_ID = GetSuppID();
            txtSupplier_Code.Text = Supp_ID;
            DataSet ds = BLL_ASL_Supplier.Get_Supplier_Evaluation_List(UDFLib.ConvertStringToNull(Supp_ID), EvalID);
            if (ds.Tables[2].Rows.Count > 0)
            {
                txtSupplierCode.Text  = ds.Tables[2].Rows[0]["Supplier_Code"].ToString();
                txtType.Text          = ds.Tables[2].Rows[0]["Supp_Type"].ToString();
                txtSubType.Text       = ds.Tables[2].Rows[0]["Counterparty_Type"].ToString();
                txtStatus.Text        = ds.Tables[2].Rows[0]["Supp_Status"].ToString();
                txtCompanyName.Text   = ds.Tables[2].Rows[0]["Register_Name"].ToString();
                txtIncorporation.Text = ds.Tables[2].Rows[0]["Setup_Year"].ToString();
                txtAddress.Text       = ds.Tables[2].Rows[0]["Address"].ToString();
                txtPhone.Text         = ds.Tables[2].Rows[0]["Phone"].ToString();
                txtEmail.Text         = ds.Tables[2].Rows[0]["Email"].ToString();
                txtFax.Text           = ds.Tables[2].Rows[0]["Fax"].ToString();
                txtPICName.Text       = ds.Tables[2].Rows[0]["Contact_1"].ToString();
                txtPICEmail.Text      = ds.Tables[2].Rows[0]["Contact_1_Email"].ToString();
                txtPICPhone.Text      = ds.Tables[2].Rows[0]["Contact_1_Phone"].ToString();
                txtRegistedData.Text  = ds.Tables[2].Rows[0]["Record_Status"].ToString();
                txtSupplierDesc.Text  = ds.Tables[2].Rows[0]["Supplier_Description"].ToString();
                if (ds.Tables[2].Rows[0]["Record_Status"].ToString() != "")
                {
                    btnRegisteredData.Visible = true;
                }
                else
                {
                    btnRegisteredData.Visible = false;
                }
                UserAccessTypeValidation(txtType.Text);
                BindApproverList(txtType.Text);
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["Evaluation_Status"].ToString() == "Approved")
                {
                    ViewState["ReturnEvalutionID"] = 0;
                    ClearControl();
                }
                else if (ds.Tables[0].Rows[0]["Evaluation_Status"].ToString() == "Rejected")
                {
                    ViewState["ReturnEvalutionID"] = 0;
                    ClearControl();
                }
                else
                {
                    ViewState["ReturnEvalutionID"] = ds.Tables[0].Rows[0]["Evaluation_ID"].ToString();
                    if (ds.Tables[0].Rows[0]["Supp_Status"].ToString() != "")
                    {
                        ddlProposedStatus.SelectedValue = ds.Tables[0].Rows[0]["Supp_Status"].ToString();
                    }
                    txtSupplierDesc.Text       = ds.Tables[0].Rows[0]["Supplier_Description"].ToString();
                    ddlforPeriod.SelectedValue = ds.Tables[0].Rows[0]["Approval_Period"].ToString();
                    txtRemarks.Text            = ds.Tables[0].Rows[0]["Justification_Remarks"].ToString();
                    txtVerificationRemrks.Text = ds.Tables[0].Rows[0]["Verifier_Remarks"].ToString();
                    txtApprovalRemrks.Text     = ds.Tables[0].Rows[0]["Approver_Remarks"].ToString();

                    txtCreatedDate.Text       = ds.Tables[0].Rows[0]["Created_Date"].ToString();
                    txtApprovedDate.Text      = ds.Tables[0].Rows[0]["Approved_Date"].ToString();
                    txtFinalApprovedDate.Text = ds.Tables[0].Rows[0]["FinalApproved_Date"].ToString();
                    if (ddlApproverName.Items.FindByValue(ds.Tables[0].Rows[0]["SentForApproval"].ToString()) == null)
                    {
                        ddlApproverName.SelectedValue = "0";
                    }
                    else
                    {
                        ddlApproverName.SelectedValue = ds.Tables[0].Rows[0]["SentForApproval"].ToString();
                    }
                    if (ddlFinalApproverName.Items.FindByValue(ds.Tables[0].Rows[0]["SentForfinalApproval"].ToString()) == null)
                    {
                        ddlFinalApproverName.SelectedValue = "0";
                    }
                    else
                    {
                        ddlFinalApproverName.SelectedValue = ds.Tables[0].Rows[0]["SentForfinalApproval"].ToString();
                    }
                    lblEvalStatus.Text = ds.Tables[0].Rows[0]["Evaluation_Status"].ToString();
                    lblCreatedby.Text  = ds.Tables[0].Rows[0]["Created_Name"].ToString();
                    txtEvalID.Text     = ds.Tables[0].Rows[0]["Evaluation_ID"].ToString();
                    string str = ds.Tables[0].Rows[0]["Urgent_Flag"].ToString();
                    if (str == "Yes")
                    {
                        chkUrgent.Checked = true;
                    }
                    else
                    {
                        chkUrgent.Checked = false;
                    }
                    btnSaveEvalution.Visible = true;
                    btnVerify.Visible        = true;
                }
                Visibelbutton(false);
                if (ds.Tables[0].Rows[0]["Evaluation_Status"].ToString() == "Rework")
                {
                    if (UDFLib.ConvertToInteger(GetSessionUserID()) == UDFLib.ConvertToInteger(ds.Tables[0].Rows[0]["Created_By"].ToString()))
                    {
                        EnableDisable(true);
                        btnSaveEvalution.Visible      = true;
                        btnVerify.Visible             = true;
                        txtRemarks.Enabled            = true;
                        txtApprovalRemrks.Enabled     = false;
                        txtVerificationRemrks.Enabled = false;
                    }
                }
                else if (ds.Tables[0].Rows[0]["Evaluation_Status"].ToString() == "DRAFT")
                {
                    if (UDFLib.ConvertToInteger(GetSessionUserID()) == UDFLib.ConvertToInteger(ds.Tables[0].Rows[0]["Created_By"].ToString()))
                    {
                        btnDelete.Visible = true;
                    }
                    else
                    {
                        btnDelete.Visible = false;
                    }
                    EnableDisable(true);
                    txtApprovalRemrks.Enabled     = false;
                    txtVerificationRemrks.Enabled = false;
                    txtRemarks.Enabled            = true;
                    btnSaveEvalution.Visible      = true;
                    btnVerify.Visible             = true;
                    btnRecallVerification.Visible = false;
                    btnRework.Visible             = false;
                    btnRejected.Visible           = false;
                    btnRecallApproval.Visible     = false;
                    btnApproval.Visible           = false;
                    btnRecallApproval.Visible     = false;
                }
                else if (ds.Tables[0].Rows[0]["Evaluation_Status"].ToString() == "Approval")
                {
                    btnDelete.Visible        = false;
                    btnSaveEvalution.Visible = false;
                    btnVerify.Visible        = false;
                    if (UDFLib.ConvertToInteger(GetSessionUserID()) == UDFLib.ConvertToInteger(ds.Tables[0].Rows[0]["Created_By"].ToString()))
                    {
                        EnableDisable(false);
                        btnRecallVerification.Visible = true;
                        //if (UDFLib.ConvertToInteger(GetSessionUserID()) == UDFLib.ConvertToInteger(ds.Tables[0].Rows[0]["SentForApproval"].ToString()))
                        //{
                        //    btnRecallVerification.Visible = true;
                        //}
                        //else
                        //{
                        //    btnRecallVerification.Visible = true;
                        //}
                    }
                    else
                    {
                        EnableDisable(false);
                        btnRecallVerification.Visible = true;
                        btnforApproval.Visible        = true;
                        btnRework.Visible             = true;
                        btnforApproval.Enabled        = false;
                        btnRework.Enabled             = false;
                    }
                    if (UDFLib.ConvertToInteger(GetSessionUserID()) == UDFLib.ConvertToInteger(ds.Tables[0].Rows[0]["SentForApproval"].ToString()))
                    {
                        txtVerificationRemrks.Enabled = true;
                        btnforApproval.Visible        = true;
                        btnRework.Visible             = true;
                        ddlApproverName.Enabled       = false;
                        btnRecallApproval.Visible     = false;
                        btnforApproval.Enabled        = true;
                        btnRework.Enabled             = true;
                    }
                    else
                    {
                        btnforApproval.Visible = true;
                        btnRework.Visible      = true;
                        btnforApproval.Enabled = false;
                        btnRework.Enabled      = false;
                    }
                }
                else if (ds.Tables[0].Rows[0]["Evaluation_Status"].ToString() == "FinalApproval")
                {
                    btnDelete.Visible             = false;
                    btnSaveEvalution.Visible      = false;
                    btnVerify.Visible             = false;
                    btnRecallVerification.Visible = false;
                    if (UDFLib.ConvertToInteger(GetSessionUserID()) == UDFLib.ConvertToInteger(ds.Tables[0].Rows[0]["Created_By"].ToString()))
                    {
                        EnableDisable(false);
                    }
                    else
                    {
                        EnableDisable(false);
                        btnRecallApproval.Visible = false;
                    }
                    if (UDFLib.ConvertToInteger(GetSessionUserID()) == UDFLib.ConvertToInteger(ds.Tables[0].Rows[0]["SentForApproval"].ToString()))
                    {
                        EnableDisable(false);
                        btnRecallApproval.Visible = true;
                        btnforApproval.Visible    = false;
                        btnRework.Visible         = false;
                    }
                    else
                    {
                        btnApproval.Visible = true;
                        btnRejected.Visible = true;
                        btnApproval.Enabled = false;
                        btnRejected.Enabled = false;
                    }
                    if (UDFLib.ConvertToInteger(GetSessionUserID()) == UDFLib.ConvertToInteger(ds.Tables[0].Rows[0]["SentForfinalApproval"].ToString()))
                    {
                        //EnableDisable(true);
                        txtApprovalRemrks.Enabled = true;
                        btnApproval.Visible       = true;
                        btnApproval.Enabled       = true;
                        btnRejected.Enabled       = true;
                        btnRejected.Visible       = true;
                        //btnRecallApproval.Visible = false;
                    }
                    else
                    {
                        btnApproval.Visible = true;
                        btnRejected.Visible = true;
                        btnApproval.Enabled = false;
                        btnRejected.Enabled = false;
                    }
                }
            }
            else
            {
                ClearControl();
            }
            if (ds.Tables[1].Rows.Count > 0)
            {
                dvEvalProgress.Visible    = true;
                gvEvalProgress.DataSource = ds.Tables[1];
                gvEvalProgress.DataBind();
            }
            else
            {
                dvEvalProgress.Visible    = false;
                gvEvalProgress.DataSource = ds.Tables[1];
                gvEvalProgress.DataBind();
            }
        }
        catch { }
        {
        }
    }
Exemplo n.º 15
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();

        dt.Columns.Add("User_ID", typeof(Int16));
        dt.Columns.Add("MAX_APPROVAL_LIMIT", typeof(decimal));

        int       UserId;
        int       UserSelectedCount = 0;
        decimal   MAX_APPROVAL_LIMIT;
        bool      Selected;
        string    js             = "";
        string    ApproverType   = ddlType.SelectedValue;
        ArrayList ApproverAmount = new ArrayList();

        AmountApplicable = objBLLAppLimit.CheckAmountApplicable(ddlType.SelectedValue.ToString(), AmountApplicable);
        foreach (GridViewRow dr in gvUserApprovalList.Rows)
        {
            Selected = ((CheckBox)dr.FindControl("chkSelected")).Checked;
            if (Selected == true)
            {
                UserSelectedCount++;
                UserId = int.Parse(((Label)dr.FindControl("lblUserId")).Text.ToString());
                if (AmountApplicable == 1)
                {
                    if (((TextBox)dr.FindControl("txtAmount")).Text.ToString() != "")
                    {
                        MAX_APPROVAL_LIMIT = decimal.Parse(((TextBox)dr.FindControl("txtAmount")).Text.ToString());
                        if (ApproverType == "AdvanceApprover")
                        {
                            if (ApproverAmount.Contains(MAX_APPROVAL_LIMIT))
                            {
                                js = "alert('There can be only one approver with specific amount');";
                                break;
                            }
                            ApproverAmount.Add(MAX_APPROVAL_LIMIT);
                        }
                    }
                    else
                    {
                        MAX_APPROVAL_LIMIT = 0;
                    }
                    if (MAX_APPROVAL_LIMIT == 0)
                    {
                        js = "alert('Approval Limit is mandatory');";
                        break;
                    }
                }
                else
                {
                    MAX_APPROVAL_LIMIT = 0;
                }
                dt.Rows.Add(UserId, MAX_APPROVAL_LIMIT);
            }
        }

        if (UserSelectedCount == 0)
        {
            js = "alert('Select user for approval');";
        }
        if (js == "")
        {
            int responseid = objBLLAppLimit.INS_Approval_Limit(UDFLib.ConvertIntegerToNull(DDLGroup.SelectedValue), ddlType.SelectedValue.ToString(), dt, Convert.ToInt32(Session["USERID"]));
            BindUserApproval();
            string hidemodal = String.Format("hideModal('divadd')");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "status", js, true);
            string AddUserTypemodal = String.Format("showModal('divadd',false);");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddUserTypemodal", AddUserTypemodal, true);
        }
    }
Exemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserAccessValidation();


        RequestID         = Convert.ToInt32(Request.QueryString["requestid"].ToString());
        dvInvoice.Visible = false;



        if (!IsPostBack)
        {
            Attach_Type = UDFLib.ConvertStringToNull(Request.QueryString["AttType"]);

            if (Attach_Type != null)
            {
                ListItem liAttch = ddlAttachmentType.Items.FindByValue(Attach_Type);
                if (liAttch != null)
                {
                    liAttch.Selected = true;
                }

                if (liAttch.Value == "INVOICE")
                {
                    dvInvoice.Visible = true;
                }
                else
                {
                    dvInvoice.Visible = false;
                }
            }

            if (UDFLib.ConvertStringToNull((Request.QueryString["REQSTS"])) == "APPROVED")
            {
                ddlAttachmentType.ClearSelection();
                ddlAttachmentType.Items.FindByValue("ETICKET").Selected = true;
            }



            //string CkeckForInvoce = String.Format("CkeckForInvoce();");
            //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "CkeckForInvoce", CkeckForInvoce, true);
        }


        Attach_Type = ddlAttachmentType.SelectedValue;
        if (Attach_Type == "ETICKET")
        {
            lblhdrAttach.Visible = false;
            flName.Visible       = false;
            cmdUpload.Visible    = false;
        }
        else
        {
            lblhdrAttach.Visible = true;
            flName.Visible       = true;
            cmdUpload.Visible    = true;
        }

        GetAttachment(RequestID, Attach_Type);
    }
Exemplo n.º 17
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 = objBLLAppLimit.Get_Approval_Limit_Search(txtfilter.Text != "" ? txtfilter.Text : null, UDFLib.ConvertIntegerToNull(DDLGroupFilter.SelectedValue)
                                                                , UDFLib.ConvertIntegerToNull(DDLUserFilter.SelectedValue), sortbycoloumn, sortdirection
                                                                , null, null, ref rowcount);

        string[] HeaderCaptions  = { "Group Name", "User Name", "Approval Limit" };
        string[] DataColumnsName = { "Group_Name", "UserName", "MAX_APPROVAL_LIMIT" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "ApprovalLimit", "Approval Limit", "");
    }
Exemplo n.º 18
0
    /// <summary>
    /// To save or update oil major
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnsave_OnClick(object sender, EventArgs e)
    {
        try
        {
            if (Convert.ToInt32(hdnOilMajorID.Value) > 0)
            {
                OperationMode = "Edit Oil Major";

                int     rowcount = 0;
                DataSet dt       = objBLL.CRUD_OilMajorsRules(txtOilMajorName.Text.Trim(), "U", GetSessionUserID(), Convert.ToInt32(hdnOilMajorID.Value), null, "", null, null, null, ref rowcount, ref Result);

                ///Result == 2 Already exists
                if (Result < 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("InformationMessage/DataExists") + "');showModal('divadd', false);", true);
                }
                else if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/UpdateMessage") + "');hideModal('divadd');", true);
                    BindOilMajorsRules();
                }
            }
            else
            {
                int     rowcount = 0;
                DataSet dt       = objBLL.CRUD_OilMajorsRules(txtOilMajorName.Text.Trim(), "I", GetSessionUserID(), 0, null, "", null, null, null, ref rowcount, ref Result);

                ///Result == 2 Already exists
                if (Result < 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("InformationMessage/DataExists") + "');showModal('divadd', false);", true);
                }
                else if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/SaveMessage") + "');hideModal('divadd');", true);
                    BindOilMajorsRules();
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Exemplo n.º 19
0
    protected void BindItems()
    {
        string sFromDate = "";
        string sToDate   = "";

        if (ViewState["sFromDT"].ToString() == "")
        {
            sFromDate = "1900/01/01";
        }
        else
        {
            sFromDate = ViewState["sFromDT"].ToString();
        }
        if (ViewState["sToDT"].ToString() == "")
        {
            sToDate = "1900/01/01";
        }
        else
        {
            sToDate = ViewState["sToDT"].ToString();
        }

        int Record_count = 0;

        gvVoyageReport.DataSource = BLL_OPS_VoyageReports.Get_VoyageReportIndex(ViewState["sReportType"].ToString(), Convert.ToInt32(ViewState["iVesselID"]), Convert.ToInt32(ViewState["iLocationID"]), sFromDate, sToDate, Convert.ToInt32(ViewState["iFleetID"]),
                                                                                UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CurrentPageIndex),
                                                                                UDFLib.ConvertIntegerToNull(ucCustomPagerItems.PageSize), ref Record_count, UDFLib.ConvertStringToNull(ViewState["Sort_Column"]), UDFLib.ConvertStringToNull(ViewState["Sort_Direction"]));

        gvVoyageReport.DataBind();

        ucCustomPagerItems.CountTotalRec = Record_count.ToString();
        ucCustomPagerItems.BuildPager();
    }
Exemplo n.º 20
0
    protected void onDelete(object source, CommandEventArgs e)
    {
        try
        {
            int     rowcount = 0;
            DataSet dt       = objBLL.CRUD_OilMajorsRules("", "D", GetSessionUserID(), Convert.ToInt32(e.CommandArgument.ToString()), null, "", null, null, null, ref rowcount, ref Result);
            if (Result > 0)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ShowMessage", "alert('" + UDFLib.GetException("SuccessMessage/DeleteMessage") + "')", true);
            }

            BindOilMajorsRules();
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }
    public void GetRelatedOpenObservationCount(int QuestionID, int FleetCode)
    {
        BLL_VET_Index objBLLIndx     = new BLL_VET_Index();
        DataTable     dtOpenObsCount = objBLLIndx.VET_Get_RelatedOpenObsCount();

        string filterpenexpression = filterpenexpression = " Question_ID=" + UDFLib.ConvertToInteger(QuestionID) + " and FleetCode=" + UDFLib.ConvertToInteger(FleetCode);

        DataRow[] drOpnObsCount = dtOpenObsCount.Select(filterpenexpression);
        if (drOpnObsCount.Length <= 0)
        {
            lnkRelatedObs.Text    = "0";
            lnkRelatedObs.Enabled = false;
        }
        else
        {
            lnkRelatedObs.Text    = drOpnObsCount[0][0].ToString();
            lnkRelatedObs.Enabled = true;
        }
    }
Exemplo n.º 22
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int Res = BLL_PB_PortageBill.INS_Crew_Salary_Instruction(GetCrewID(), UDFLib.ConvertToInteger(ddlVessel.SelectedValue), GetVoyageID(), UDFLib.ConvertToInteger(rdoEarndeduction.SelectedValue), txtPBDate.Text, UDFLib.ConvertToInteger(ddlType.SelectedValue), UDFLib.ConvertToDecimal(txtAmount.Text), txtRemarks.Text, GetSessionUserID());

        Load_SalInstructions();
        if (Res == 1)
        {
            lblMessage.Text = "Salary instruction added for the crew";
        }
    }
    protected void ddlQuestion_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            BLL_VET_Index objBLLIndx = new BLL_VET_Index();
            if (ddlQuestion.SelectedValue != "0")
            {
                ViewState["ddlQuestionNo"] = ddlQuestion.SelectedValue;
                DataTable dtQuestionNo = objBLLIndx.VET_Get_QuestionByQuestionNo(UDFLib.ConvertToInteger(ViewState["ddlQuestionNo"].ToString()));
                if (dtQuestionNo.Rows.Count > 0)
                {
                    if (Convert.ToString(dtQuestionNo.Rows[0]["Question"]) != "")
                    {
                        lblQuestion.Text = dtQuestionNo.Rows[0]["Question"].ToString();
                    }
                }

                GetRelatedOpenObservationCount(UDFLib.ConvertToInteger(ddlQuestion.SelectedValue), UDFLib.ConvertToInteger(ViewState["FleetCode"].ToString()));
                dvbadge.Visible           = true;
                lnkRelatedObs.Enabled     = true;
                lnkRelatedObs.NavigateUrl = "Vetting_ObservationIndex.aspx?Question_ID=" + ddlQuestion.SelectedValue + "&FleetCode=" + ViewState["FleetCode"].ToString() + "&Vetting_Type_ID=" + ViewState["Vetting_Type_ID"].ToString() + "&Status=Open" + "&Parent=AON";
            }
            else
            {
                lblQuestion.Text      = "";
                dvbadge.Visible       = false;
                lnkRelatedObs.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
            string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
        }
    }
    //protected void ImgAdd_Click(object sender, EventArgs e)
    //{
    //    this.SetFocus("ctl00_MainContent_txtApprovalGroup");
    //    HiddenFlag.Value = "Add";

    //    OperationMode = "Add Approval Group";
    //    txtApprovalGroup.Text = "";

    //    string AddUserTypemodal = String.Format("showModal('divadd',false);");
    //    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddUserTypemodal", AddUserTypemodal, true);
    //}

    //protected void btnsave_Click(object sender, EventArgs e)
    //{


    //    if (HiddenFlag.Value == "Add")
    //    {
    //        int responseid = objBLLAppGroup.INS_Approval_Group(txtApprovalGroup.Text, Convert.ToInt32(Session["USERID"]));

    //    }
    //    else
    //    {
    //        int responseid = objBLLAppGroup.Upd_Approval_Group(Convert.ToInt32(txtGroupID.Text), txtApprovalGroup.Text, Convert.ToInt32(Session["USERID"]));

    //    }

    //    BindApprovalGroup();
    //    string hidemodal = String.Format("hideModal('divadd')");
    //    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);

    //}

    //protected void onUpdate(object source, CommandEventArgs e)
    //{

    //    HiddenFlag.Value = "Edit";
    //    OperationMode = "Edit Approval Group";

    //    DataTable dt = new DataTable();
    //    dt = objBLLAppGroup.Get_Approval_Group_List_DL(Convert.ToInt32(e.CommandArgument.ToString()));
    //    dt.DefaultView.RowFilter = "Group_ID= '" + e.CommandArgument.ToString() + "'";

    //    txtGroupID.Text = dt.DefaultView[0]["Group_ID"].ToString();
    //    txtApprovalGroup.Text = dt.DefaultView[0]["Group_Name"].ToString();

    //    string AddUserTypemodal = String.Format("showModal('divadd',false);");
    //    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddUserTypemodal", AddUserTypemodal, true);

    //}

    protected void onDelete(object source, CommandEventArgs e)
    {
        int retval = BLL_POLOG_Lib.Del_Approval_Group(UDFLib.ConvertStringToNull(e.CommandArgument.ToString()), Convert.ToInt32(Session["USERID"]));

        BindApprovalGroup();
    }
 /// <summary>
 /// Method is used to get observation related worklist jobs of particular vetting and observation.
 /// </summary>
 public void VET_Get_ObsRelatedJobs()
 {
     try
     {
         BLL_VET_Index objBLLIndx = new BLL_VET_Index();
         DataSet       ds         = new DataSet();
         ds = objBLLIndx.VET_Get_ObsRelatedJobs(UDFLib.ConvertToInteger(ViewState["Vetting_ID"].ToString()), UDFLib.ConvertToInteger(ViewState["Observation_ID"].ToString()));
         if (ds != null)
         {
             gvRelatedJob.DataSource = ds.Tables[0];
             gvRelatedJob.DataBind();
         }
     }
     catch (Exception ex)
     {
         UDFLib.WriteExceptionLog(ex);
         string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');";
         ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true);
     }
 }
    protected void ImgExpExcel_Click(object sender, ImageClickEventArgs e)
    {
        int rowcount = int.Parse(ucCustomPagerItems.CountTotalRec);

        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.Get_SlopChestConsumptionReport(txtDate.Text != "" ? txtDate.Text : null, txtCrew.Text.Trim() != "" ? txtCrew.Text.Trim() : null, UDFLib.ConvertIntegerToNull(ddItem.SelectedValue), 1, rowcount, ref rowcount);


        string[] HeaderCaptions  = { "Date", "Crew", "Item Description", "Item Price", "Quantity", "Final Amount" };
        string[] DataColumnsName = { "DATE", "CrewDetail", "ITEM", "PRICE", "QUANTITY", "FINAL_AMOUNT" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "SlopChest Consumpsion Report", "SlopChest Consumpsion Report", "");
    }
    protected void gvRelatedJob_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label lblDateRaised = (Label)e.Row.FindControl("lblDateRaised");

                HiddenField hdnWLID  = (HiddenField)e.Row.FindControl("hdnWLID");
                HiddenField hdnOFFID = (HiddenField)e.Row.FindControl("hdnOFFID");
                HiddenField hdnVID   = (HiddenField)e.Row.FindControl("hdnVID");

                lblDateRaised.Text = UDFLib.ConvertUserDateFormat(lblDateRaised.Text, UDFLib.GetDateFormat());
                HyperLink lnkVerJobsCnt = (HyperLink)e.Row.FindControl("lnkVerJobsCnt");

                lnkVerJobsCnt.NavigateUrl = "../Worklist/ViewJob.aspx?Vetting_ID=" + ViewState["Vetting_ID"].ToString() + "&WLID=" + hdnWLID.Value + "&OFFID=" + hdnOFFID.Value + "&VID=" + hdnVID.Value;
                if (Vetting_Status == "Completed")
                {
                    ImageButton ImglnkJob = (ImageButton)e.Row.FindControl("ImglnkJob");
                    ImglnkJob.Enabled = false;
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    public void BindConsumption()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        //int comID = UDFLib.ConvertToInteger(Session["USERCOMPANYID"]);

        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.SearchCompany(txtfilter.Text != "" ? txtfilter.Text : null, UDFLib.ConvertIntegerToNull(ddlCompanyTypeFilter.SelectedValue), UDFLib.ConvertIntegerToNull(ddlCountryIncorpFilter.SelectedValue)
        //    , UDFLib.ConvertIntegerToNull(ddlCurrencyFilter.SelectedValue), UDFLib.ConvertIntegerToNull(ddlCountryFilter.SelectedValue), sortbycoloumn, sortdirection
        //  , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref  rowcount);

        DataTable dt = objBLL.Get_SlopChestConsumptionReport(txtDate.Text != "" ? txtDate.Text:null, txtCrew.Text.Trim() != "" ? txtCrew.Text.Trim() : null, UDFLib.ConvertIntegerToNull(ddItem.SelectedValue),
                                                             ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); //UDFLib.ConvertIntegerToNull(ddlYearFilter.SelectedItem.Text)

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


        if (dt.Rows.Count != 0)
        {
            GvSCDisplayConsumption.DataSource = dt;
            GvSCDisplayConsumption.DataBind();
        }
        else
        {
            GvSCDisplayConsumption.DataSource = dt;
            GvSCDisplayConsumption.DataBind();
        }
    }
    public void VET_Get_QuestionByVettingId_SectionNo()
    {
        BLL_VET_Index objBLLIndx = new BLL_VET_Index();

        ddlQuestion.DataSource     = objBLLIndx.VET_Get_QuestionByVettingId_SectionNo(UDFLib.ConvertToInteger(ViewState["Vetting_ID"].ToString()), UDFLib.ConvertToInteger(ddlSection.SelectedValue), ViewState["Mode"].ToString());
        ddlQuestion.DataTextField  = "Question_No";
        ddlQuestion.DataValueField = "ID";
        ddlQuestion.DataBind();
        ddlQuestion.Items.Insert(0, new ListItem("-Select-", "0"));
    }
Exemplo n.º 30
0
    protected void btnSaveCommand_Click(object sender, EventArgs e)
    {
        try
        {
            int PROCEDURE_ID = BLL_QMSDB_Procedures.QMSDBProcedures_InsertWithSection(txtProcedureCode.Text, txtProcedureName.Text, UDFLib.ConvertToInteger(ddlFolderName.SelectedValue), FileWateMark.Checked == true ? 1 : 0, UDFLib.ConvertIntegerToNull(ddlHeaderTemplate.SelectedValue), UDFLib.ConvertIntegerToNull(ddlFooterTemlate.SelectedValue), UDFLib.ConvertToInteger(Session["USERID"]), "");
            if (PROCEDURE_ID > 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "reloadparent", "parent.RealoadParent();", true);
                ResponseHelper.Redirect("ProcedureBuilder.aspx?PROCEDURE_ID=" + PROCEDURE_ID.ToString(), "blank", "");
            }
        }

        catch (Exception ex)
        {
            string js = "alert('" + ex.Message.Replace("'", "") + "');";
            Page.ClientScript.RegisterStartupScript(GetType(), "script", js, true);
        }
    }