Example #1
0
    protected void AddTextBox(int id)
    {
        DataSet ds;

        if (Session["FeeType"].ToString() == "2")
        {
            ds = BLL_Crew_Disbursement.Get_MOProcessingFee(id);
        }
        else
        {
            ds = BLL_Crew_Disbursement.Get_MOAgencyFee(id);
        }
        DataTable dt = ds.Tables[0];

        foreach (DataColumn column in dt.Columns)
        {
            string sColumName = "";
            if (column.ColumnName.Contains("Amt"))
            {
                sColumName = column.ColumnName.Replace("Amt", "").TrimEnd().Replace(" ", "_") + "_ID";
            }
            if (column.ColumnName.Contains("Amt") || column.ColumnName.Contains("Date") || column.ColumnName.Contains("DATE"))
            {
                Literal lts = new Literal();
                lts.Text = "<table>";
                pnlTextBoxes.Controls.Add(lts);
                this.CreateTextBox("txt" + column.ColumnName, column.ColumnName, Convert.ToString(dt.Rows[0][column.ColumnName]), column.ColumnName.Contains("Amt") ? Convert.ToString(dt.Rows[0][sColumName]) : ""); //Convert.ToString(dt.Rows[0].Field<string>(0))
                Literal lts1 = new Literal();
                lts1.Text = "</table>";
                pnlTextBoxes.Controls.Add(lts1);
            }
        }
        ViewState["Flag"] = pnlTextBoxes.Controls.Count;
    }
Example #2
0
    protected void GridView_Crew_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName == "AddNew")
            {
                int       ID = UDFLib.ConvertToInteger(e.CommandArgument.ToString());
                DataTable dt = BLL_Crew_Disbursement.Get_MODisbursementFeeDetails(ID, GetSessionUserID());
                if (dt.Rows.Count > 0)
                {
                    lblRank.Text          = dt.Rows[0]["Rank_Short_Name"].ToString();
                    lblStaffCode.Text     = dt.Rows[0]["Staff_Code"].ToString();
                    lblStaffName.Text     = dt.Rows[0]["StaffName"].ToString();
                    lblManningOffice.Text = dt.Rows[0]["Company_Name"].ToString();
                    lblVessel.Text        = dt.Rows[0]["Vessel_Name"].ToString();

                    Vessel_ID.Value       = dt.Rows[0]["VesselID"].ToString();
                    CrewID.Value          = dt.Rows[0]["CrewID"].ToString();
                    VoyageID.Value        = dt.Rows[0]["VoyageID"].ToString();
                    ManningOfficeID.Value = dt.Rows[0]["ManningOfficeID"].ToString();


                    ddlMonth_AddNew.SelectedIndex = 0;
                    ddlYear_AddNew.SelectedIndex  = 0;
                    txtAmount_AddNew.Text         = "";
                    txtRemarks.Text = "";

                    string js = "openPopup_AddNewDisb();";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "showPopup", js, true);
                }
            }
        }
        catch { }
    }
Example #3
0
    protected void Load_CrewProcessingFee()
    {
        int    FleetCode       = UDFLib.ConvertToInteger(ddlFleet.SelectedValue);
        int    VesselID        = UDFLib.ConvertToInteger(ddlVessel.SelectedValue);
        int    ManningOfficeID = UDFLib.ConvertToInteger(ddlManningOffice.SelectedValue);
        int    Rank_Category   = UDFLib.ConvertToInteger(ddlRankCategory.SelectedValue);
        int    Crew_Status     = UDFLib.ConvertToInteger(ddlStatus.SelectedValue);
        int    Fee_Type        = UDFLib.ConvertToInteger(ddlFeeType.SelectedValue);
        int    Approved_Status = UDFLib.ConvertToInteger(rdoApprovedStatus.SelectedValue);
        string Sign_On_From    = txtSignOnFrom.Text;
        string Sign_On_To      = txtSignOnTo.Text;
        string Approved_From   = txtApprovedFrom.Text;
        string Approved_To     = txtApprovedTo.Text;
        string SearchText      = txtSearchText.Text;

        int     PAGE_SIZE         = ucCustomPager_CrewList.PageSize;
        int     PAGE_INDEX        = ucCustomPager_CrewList.CurrentPageIndex;
        int     SelectRecordCount = ucCustomPager_CrewList.isCountRecord;
        decimal GrandTotal        = 0;

        DataTable dt = BLL_Crew_Disbursement.Get_AllCrewFeeStatus(FleetCode, VesselID, ManningOfficeID, Rank_Category, GetSessionUserID(), Crew_Status, Fee_Type, Approved_Status, UDFLib.ConvertToDefaultDt(Sign_On_From), UDFLib.ConvertToDefaultDt(Sign_On_To), UDFLib.ConvertToDefaultDt(Approved_From), UDFLib.ConvertToDefaultDt(Approved_To), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount, ref GrandTotal, int.Parse(ddlMonth.SelectedValue), int.Parse(ddlYear.SelectedValue), SearchText);

        lblGrandTotal.Text = GrandTotal.ToString();

        if (ucCustomPager_CrewList.isCountRecord == 1)
        {
            ucCustomPager_CrewList.CountTotalRec = SelectRecordCount.ToString();
            ucCustomPager_CrewList.BuildPager();
        }

        GridView_Crew.DataSource = dt;
        GridView_Crew.DataBind();
    }
Example #4
0
    protected void GridView_Crew_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        try
        {
            string Remarks        = null;
            int    ID             = UDFLib.ConvertToInteger(GridView_Crew.DataKeys[e.RowIndex].Value.ToString());
            int    CrewID         = UDFLib.ConvertToInteger(e.NewValues["CrewID"].ToString());
            int    Approved_YesNo = UDFLib.ConvertToInteger(e.NewValues["Approved_YesNo"].ToString());
            string Approved_Date  = DateTime.Now.ToString("yyyy/MM/dd");

            if (e.NewValues["Remarks"] != null)
            {
                Remarks = e.NewValues["Remarks"].ToString();
            }


            int RetVal = BLL_Crew_Disbursement.UPDATE_ApprovedStatus(ID, CrewID, Approved_YesNo, Approved_Date, GetSessionUserID(), Remarks);

            if (RetVal == 0)
            {
                string js = "alert('Processing Fee is not yet set for the Manning Office');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "status", js, true);
            }

            GridView_Crew.EditIndex = -1;
            Load_CrewProcessingFee();
        }
        catch { }
    }
Example #5
0
    public void Load_VesselList()
    {
        int       Fleet_ID = UDFLib.ConvertToInteger(ddlFleet.SelectedValue);
        DataTable dt       = BLL_Crew_Disbursement.Get_VesselList_CrewFee(GetSessionUserID(), Fleet_ID);

        ddlVessel.DataSource     = dt;
        ddlVessel.DataTextField  = "VESSEL_NAME";
        ddlVessel.DataValueField = "VESSEL_ID";
        ddlVessel.DataBind();
        ddlVessel.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));
        ddlVessel.SelectedIndex = 0;
    }
Example #6
0
    protected void Load_AgencyFee()
    {
        try
        {
            DataSet ds = BLL_Crew_Disbursement.Get_MOAgencyFee(0);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                dr[4]  = Convert.ToString(dr[4]) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[4])) : "";
                dr[7]  = dr[7] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[7])) : "";
                dr[10] = dr[10] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[10])) : "";
                dr[13] = dr[13] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[13])) : "";
                dr[16] = dr[16] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[16])) : "";
                dr[19] = dr[19] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[19])) : "";
                dr[22] = dr[22] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[22])) : "";
                dr[25] = dr[25] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[25])) : "";
                dr[28] = dr[28] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[28])) : "";
                dr[31] = dr[31] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[31])) : "";
                dr[34] = dr[34] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[34])) : "";
                dr[37] = dr[37] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[37])) : "";
                dr[40] = dr[40] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[40])) : "";
                dr[43] = dr[43] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[43])) : "";
                dr[46] = dr[46] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[46])) : "";
                dr[49] = dr[49] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[49])) : "";
                dr[52] = dr[52] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[52])) : "";
                dr[55] = dr[55] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[55])) : "";
                dr[58] = dr[58] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[58])) : "";
            }

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

            gv_AgencyFeeHistory.DataSource = ds.Tables[1];
            gv_AgencyFeeHistory.DataBind();
            if (gv_AgencyFeeHistory.Rows.Count > 0)
            {
                //This replaces <td> with <th> and adds the scope attribute
                gv_AgencyFeeHistory.UseAccessibleHeader = true;

                //This will add the <thead> and <tbody> elements
                gv_AgencyFeeHistory.HeaderRow.TableSection = TableRowSection.TableHeader;

                //This adds the <tfoot> element.
                //Remove if you don't have a footer row
                //gvTheGrid.FooterRow.TableSection = TableRowSection.TableFooter;
            }
        }
        catch
        {
        }
    }
Example #7
0
    protected void ImgExportToExcel_Click(object sender, EventArgs e)
    {
        try
        {
            int    FleetCode       = UDFLib.ConvertToInteger(ddlFleet.SelectedValue);
            int    VesselID        = UDFLib.ConvertToInteger(ddlVessel.SelectedValue);
            int    ManningOfficeID = UDFLib.ConvertToInteger(ddlManningOffice.SelectedValue);
            int    Rank_Category   = UDFLib.ConvertToInteger(ddlRankCategory.SelectedValue);
            int    Crew_Status     = UDFLib.ConvertToInteger(ddlStatus.SelectedValue);
            int    Fee_Type        = UDFLib.ConvertToInteger(ddlFeeType.SelectedValue);
            int    Approved_Status = UDFLib.ConvertToInteger(rdoApprovedStatus.SelectedValue);
            string Sign_On_From    = txtSignOnFrom.Text;
            string Sign_On_To      = txtSignOnTo.Text;
            string Approved_From   = txtApprovedFrom.Text;
            string Approved_To     = txtApprovedTo.Text;
            string SearchText      = txtSearchText.Text;

            string[] HeaderCaptions  = { "Manning Office", "Vessel", "S/Code", "Name", "Rank", "S/On Date", "S/Off Date", "Fee Type", "Due Date", "Due Amt", "Approved Amt", "Approved By", "Approved Date", "Remarks" };
            string[] DataColumnsName = { "manning_Office", "Vessel_Short_Name", "Staff_Code", "Staff_FullName", "Rank_Short_Name", "Sign_On_Date1", "Sign_Off_Date1", "FeeTypeName", "Due_Date1", "Due_Amount", "Approved_Amount", "ApprovedBy", "Approved_Date1", "Remarks" };


            int     PAGE_SIZE         = 0;
            int     PAGE_INDEX        = 0;
            int     SelectRecordCount = 0;
            decimal GrandTotal        = 0;

            DataTable dt = BLL_Crew_Disbursement.Get_AllCrewFeeStatus(FleetCode, VesselID, ManningOfficeID, Rank_Category, GetSessionUserID(), Crew_Status, Fee_Type, Approved_Status, UDFLib.ConvertToDefaultDt(Sign_On_From), UDFLib.ConvertToDefaultDt(Sign_On_To), UDFLib.ConvertToDefaultDt(Approved_From), UDFLib.ConvertToDefaultDt(Approved_To), UDFLib.ConvertIntegerToNull(PAGE_SIZE), UDFLib.ConvertIntegerToNull(PAGE_INDEX), ref SelectRecordCount, ref GrandTotal, int.Parse(ddlMonth.SelectedValue), int.Parse(ddlYear.SelectedValue), SearchText);

            DataTable dt1 = new DataTable();
            dt.Columns.Add("Sign_On_Date1", typeof(string));
            dt.Columns.Add("Sign_Off_Date1", typeof(string));
            dt.Columns.Add("Due_Date1", typeof(string));
            dt.Columns.Add("Approved_Date1", typeof(string));

            foreach (DataRow dr in dt.Rows)
            {
                dr["Sign_On_Date1"]  = "&nbsp;" + (Convert.ToString(dr["Sign_On_Date"])) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Sign_On_Date"])) : "";
                dr["Sign_Off_Date1"] = "&nbsp;" + (Convert.ToString(dr["Sign_Off_Date"])) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Sign_Off_Date"])) : "";
                dr["Due_Date1"]      = "&nbsp;" + (Convert.ToString(dr["Due_Date"])) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString((dr["Due_Date"]))) : "";
                dr["Approved_Date1"] = "&nbsp;" + (Convert.ToString(dr["Approved_Date"])) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Approved_Date"])) : "";
            }


            GridViewExportUtil.ExportToExcel(dt, HeaderCaptions, DataColumnsName, "AgencyFee.xls", "Agency Fee Export");
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Example #8
0
    protected void Load_DisbFeeTypes()
    {
        DataTable dt = BLL_Crew_Disbursement.Get_MODisbursementFeeTypes();

        ddlFeeType.DataSource     = dt;
        ddlFeeType.DataTextField  = "FeeType";
        ddlFeeType.DataValueField = "FeeTypeID";
        ddlFeeType.DataBind();
        ddlFeeType.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));

        DataView dv = new DataView(dt, "FeeTypeID not in (1,2)", "FeeType", DataViewRowState.OriginalRows);

        ddlFeeType_AddNew.DataSource     = dv;
        ddlFeeType_AddNew.DataTextField  = "FeeType";
        ddlFeeType_AddNew.DataValueField = "FeeTypeID";
        ddlFeeType_AddNew.DataBind();
        ddlFeeType_AddNew.Items.Insert(0, new ListItem("-SELECT ALL-", "0"));
    }
Example #9
0
    protected void GridView_ProcessingFee_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        try
        {
            int ManningOfficeID = UDFLib.ConvertToInteger(GridView_ProcessingFee.DataKeys[e.RowIndex].Values["ID"].ToString());

            decimal Amount_VMT = UDFLib.ConvertToDecimal(GridView_ProcessingFee.DataKeys[e.RowIndex].Values[1].ToString());
            decimal Amount_Jnr = UDFLib.ConvertToDecimal(GridView_ProcessingFee.DataKeys[e.RowIndex].Values[3].ToString());
            decimal Amount_Rat = UDFLib.ConvertToDecimal(GridView_ProcessingFee.DataKeys[e.RowIndex].Values[5].ToString());

            DateTime?VMT_EffectiveDate = UDFLib.ConvertDateToNull(GridView_ProcessingFee.DataKeys[e.RowIndex].Values[2].ToString());
            DateTime?Jnr_EffectiveDate = UDFLib.ConvertDateToNull(GridView_ProcessingFee.DataKeys[e.RowIndex].Values[4].ToString());
            DateTime?Rat_EffectiveDate = UDFLib.ConvertDateToNull(GridView_ProcessingFee.DataKeys[e.RowIndex].Values[6].ToString());

            TextBox txtAmount_VMT = (TextBox)GridView_ProcessingFee.Rows[e.RowIndex].FindControl("txtAF_Officers");
            TextBox txtDate_VMT   = (TextBox)GridView_ProcessingFee.Rows[e.RowIndex].FindControl("txtEffectiveDate");

            TextBox txtAmount_Jnr = (TextBox)GridView_ProcessingFee.Rows[e.RowIndex].FindControl("txtAF_Officers_Jnr");
            TextBox txtDate_Jnr   = (TextBox)GridView_ProcessingFee.Rows[e.RowIndex].FindControl("txtAF_Officers_Jnr_Effdt");

            TextBox txtAmount_Rat = (TextBox)GridView_ProcessingFee.Rows[e.RowIndex].FindControl("txtAF_Ratings");
            TextBox txtDate_Rat   = (TextBox)GridView_ProcessingFee.Rows[e.RowIndex].FindControl("txtAF_Ratings_Effdt");

            if (Amount_VMT != UDFLib.ConvertToDecimal(txtAmount_VMT.Text) || VMT_EffectiveDate != UDFLib.ConvertDateToNull(txtDate_VMT.Text))
            {
                BLL_Crew_Disbursement.UPDATE_MODisbursementFee_DL(ManningOfficeID, 2, UDFLib.ConvertToDecimal(txtAmount_VMT.Text), UDFLib.ConvertToInteger(txtAmount_VMT.ToolTip), txtDate_VMT.Text, GetSessionUserID(), 1);
            }
            if (Amount_Jnr != UDFLib.ConvertToDecimal(txtAmount_Jnr.Text) || Jnr_EffectiveDate != UDFLib.ConvertDateToNull(txtDate_Jnr.Text))
            {
                BLL_Crew_Disbursement.UPDATE_MODisbursementFee_DL(ManningOfficeID, 2, UDFLib.ConvertToDecimal(txtAmount_Jnr.Text), UDFLib.ConvertToInteger(txtAmount_Jnr.ToolTip), txtDate_Jnr.Text, GetSessionUserID(), 2);
            }
            if (Amount_Rat != UDFLib.ConvertToDecimal(txtAmount_Rat.Text) || Rat_EffectiveDate != UDFLib.ConvertDateToNull(txtDate_Rat.Text))
            {
                BLL_Crew_Disbursement.UPDATE_MODisbursementFee_DL(ManningOfficeID, 2, UDFLib.ConvertToDecimal(txtAmount_Rat.Text), UDFLib.ConvertToInteger(txtAmount_Rat.ToolTip), txtDate_Rat.Text, GetSessionUserID(), 3);
            }


            GridView_ProcessingFee.EditIndex = -1;
            Load_ProcessingFee();
        }
        catch
        {
        }
    }
Example #10
0
    protected void Load_ProcessingFee()
    {
        try
        {
            DataSet ds = BLL_Crew_Disbursement.Get_MOProcessingFee(0);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                dr[4]  = Convert.ToString(dr[4]) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[4])) : "";
                dr[7]  = dr[7] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[7])) : "";
                dr[10] = dr[10] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[10])) : "";
                dr[13] = dr[13] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[13])) : "";
                dr[16] = dr[16] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[16])) : "";
                dr[19] = dr[19] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[19])) : "";
                dr[22] = dr[22] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[22])) : "";
                dr[25] = dr[25] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[25])) : "";
                dr[28] = dr[28] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[28])) : "";
                dr[31] = dr[31] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[31])) : "";
                dr[34] = dr[34] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[34])) : "";
                dr[37] = dr[37] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[37])) : "";
                dr[40] = dr[40] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[40])) : "";
                dr[43] = dr[43] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[43])) : "";
                dr[46] = dr[46] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[46])) : "";
                dr[49] = dr[49] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[49])) : "";
                dr[52] = dr[52] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[52])) : "";
                dr[55] = dr[55] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[55])) : "";
                dr[58] = dr[58] != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr[58])) : "";
            }

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

            gv_ProcessingFeeHistory.DataSource = ds.Tables[1];
            gv_ProcessingFeeHistory.DataBind();
        }
        catch
        {
        }
    }
Example #11
0
    protected void btnSaveNew_Click(object sender, EventArgs e)
    {
        try
        {
            string  Due_Date = ddlYear_AddNew.SelectedValue + "/" + ddlMonth_AddNew.SelectedValue + "/" + DateTime.DaysInMonth(UDFLib.ConvertToInteger(ddlYear_AddNew.SelectedValue), UDFLib.ConvertToInteger(ddlMonth_AddNew.SelectedValue)).ToString();
            decimal Amount   = UDFLib.ConvertToDecimal(txtAmount_AddNew.Text);
            string  Remarks  = txtRemarks.Text;

            int Res = BLL_Crew_Disbursement.AddNew_ProcessingFee(UDFLib.ConvertToInteger(CrewID.Value), UDFLib.ConvertToInteger(Vessel_ID.Value), UDFLib.ConvertToInteger(VoyageID.Value), UDFLib.ConvertToInteger(ManningOfficeID.Value), UDFLib.ConvertToInteger(ddlFeeType_AddNew.SelectedValue), Amount, Due_Date, GetSessionUserID(), Remarks);

            if (Res == 1)
            {
                Load_CrewProcessingFee();
                string js = "alert('Fee added successfully.');hideModal('dvAddNewDisb');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg1", js, true);
            }
        }
        catch (Exception ex)
        {
            string js = "alert('" + ex.Message.Replace("'", "") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "msg2", js, true);
        }
    }
Example #12
0
    protected void GetTextBoxValues(object sender, EventArgs e)
    {
        try
        {
            int FeeType = 1;
            if (Session["FeeType"].ToString() == "2")
            {
                OperationMode = Session["Name"].ToString() + " - Edit Processing Fee Details";
                FeeType       = 2;
            }
            else
            {
                OperationMode = Session["Name"].ToString() + " - Edit Agency Fee Details";
            }

            lblError.Text = "";
            DataTable table = new DataTable();
            table.Columns.Add("MoID", typeof(int));
            table.Columns.Add("Amount", typeof(string));
            table.Columns.Add("Date", typeof(string));
            table.Columns.Add("feeID", typeof(string));
            table.Columns.Add("Rank_Category", typeof(string));


            var list   = pnlTextBoxes.Controls.OfType <TextBox>().ToList <TextBox>();
            int b      = list.Count <TextBox>();
            int breack = 0;
            for (int i = 0; i < b; i = i + 2)
            {
                TextBox textBox1      = list[i];
                TextBox textBox2      = list[i + 1];
                string  text          = textBox1.ID;
                string  Rank_Category = textBox1.ID.Replace("txt", "");
                string  txtdate       = textBox2.ID.Replace("txt", "");
                try
                {
                    if (validation(textBox1.Text, Convert.ToDateTime(textBox2.Text).ToString("dd/MM/yyyy"), Rank_Category, txtdate) == 1)
                    {
                        DateTime date  = Convert.ToDateTime(textBox2.Text);
                        string   sDate = date.ToString("MM/dd/yyyy");
                        table.Rows.Add(Session["ID"].ToString(), textBox1.Text, sDate, textBox1.ToolTip, Rank_Category.Replace(" Amt ", ""));
                    }
                    else
                    {
                        string AddAssignermodal1 = String.Format("showModal('divadd',false);aftercall();");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddAssignermodal", AddAssignermodal1, true);
                        breack = 1;
                        break;
                    }
                }
                catch
                {
                    string AddAssignermodal1 = String.Format("showModal('divadd',false);aftercall();");
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddAssignermodal1", AddAssignermodal1, true);
                    breack = 1;
                    break;
                }
            }
            if (breack == 1)
            {
                string AddAssignermodal1 = String.Format("showq'divadd',false);aftercall();");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddAssignermodal", AddAssignermodal1, true);
            }
            else
            {
                int result = BLL_Crew_Disbursement.UPDATE_MODisbursementFee_DL(table, FeeType, GetSessionUserID());
                if (Session["FeeType"].ToString() == "2")
                {
                    Load_ProcessingFee();
                    if (result >= 1)
                    {
                        string AddAssignermodal = String.Format("hideModal('divadd',false);alert('Processing Fee Updated successfully...!');aftercall();");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddAssignermodal", AddAssignermodal, true);
                    }
                    else
                    {
                        string AddAssignermodal = String.Format("showModal('divadd',false);alert('Processing fee is not updated successfully...!');aftercall();");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddAssignermodal", AddAssignermodal, true);
                    }
                }
                else
                {
                    Load_AgencyFee();
                    if (result >= 1)
                    {
                        string AddAssignermodal = String.Format("hideModal('divadd',false);alert('Agency Fee Updated successfully...!');aftercall();");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddAssignermodal", AddAssignermodal, true);
                    }
                    else
                    {
                        string AddAssignermodal = String.Format("showModal('divadd',false);alert('Agency fee is not updated successfully...!');aftercall();");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AddAssignermodal", AddAssignermodal, true);
                    }
                }
            }
        }
        catch (Exception)
        {
        }
    }