Ejemplo n.º 1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        i = Checkvalue(Convert.ToDecimal(txtInvoiceValue.Text), Convert.ToDecimal(txtGST.Text), ddlType.SelectedValue);
        if (i == 0)
        {
            string Status    = "Received";
            string InvStatus = "Received";
            //txtInvoiceID.Text = "000000";
            string retval = BLL_POLOG_Invoice.POLog_Insert_Invoice(UDFLib.ConvertStringToNull(txtInvoiceID.Text), UDFLib.ConvertIntegerToNull(GetSupplyID()),
                                                                   UDFLib.ConvertStringToNull(ddlType.SelectedValue), UDFLib.ConvertDateToNull(txtInvoiceDate.Text.Trim()), txtReferance.Text.Trim(),
                                                                   UDFLib.ConvertDateToNull(txtReceivedDate.Text.Trim()), UDFLib.ConvertDecimalToNull(txtInvoiceValue.Text.Trim()), ddlCurrency.SelectedValue, UDFLib.ConvertDecimalToNull(txtGST.Text.Trim()),
                                                                   UDFLib.ConvertDateToNull(txtDueDate.Text.Trim()), InvStatus, UDFLib.ConvertDateToNull(txtPaymentDate.Text.Trim()), txtRemarks.Text.Trim(), Status,
                                                                   UDFLib.ConvertToInteger(GetSessionUserID()));

            txtInvoiceID.Text = Convert.ToString(retval);
            BindInvoice();

            string Action      = "New Invoice";
            string Description = "NewInvoice";
            int    RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(lblInvoiceID.Text), Action, Description, UDFLib.ConvertToInteger(GetSessionUserID()));

            string message = "alert('Invoice Saved.')";
            ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
        }
        else if (i == 1)
        {
            string message = "alert('Invoice and GST value should be negative for credit note Invoice Type.')";
            ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
        }
        else if (i == 2)
        {
            string message = "alert('Invoice and GST value should be positive.')";
            ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
        }
    }
Ejemplo n.º 2
0
    public void BindGrid()
    {
        DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Transfer_Cost(hiddenTransfer.Value, Convert.ToInt32(GetSessionUserID()));

        gvTransferCost.DataSource = ds.Tables[0];
        gvTransferCost.DataBind();
        if (ds.Tables[0].Rows.Count > 0)
        {
            string Amount = ds.Tables[0].Rows[0]["Transfer_Amount"].ToString();
            Parent_invoice_id.Value            = ds.Tables[0].Rows[0]["Parent_Invoice_ID"].ToString();
            Parent_Supply_id.Value             = ds.Tables[0].Rows[0]["Parent_Supply_ID"].ToString();
            hiddenTransferStatus.Value         = ds.Tables[0].Rows[0]["Transfer_status"].ToString();
            txtAmount.Text                     = (Math.Round(Convert.ToDouble(Amount))).ToString();
            ddlVessel.SelectedValue            = ds.Tables[0].Rows[0]["New_Vessel_ID"].ToString();
            ddlOwnerCode.SelectedValue         = ds.Tables[0].Rows[0]["New_Owner_Code"].ToString();
            ddlAccClassification.SelectedValue = ds.Tables[0].Rows[0]["New_Account_Classification"].ToString();
            txtRemarks.Text                    = ds.Tables[0].Rows[0]["Transfer_Description"].ToString();
        }
        if (ds.Tables[1].Rows.Count > 0)
        {
            BindPlaceHolder(ds.Tables[1]);
        }
        else
        {
            divGrid.Visible = false;
        }
        if (ds.Tables[2].Rows.Count > 0)
        {
            BindAmount(ds.Tables[2]);
        }
    }
Ejemplo n.º 3
0
 protected void btnUnApprove_Click(object sender, EventArgs e)
 {
     i = Checkvalue(Convert.ToDecimal(txtInvoiceValue.Text), Convert.ToDecimal(txtGST.Text), ddlType.SelectedValue);
     if (i == 0)
     {
         string Status    = "Verified";
         string InvStatus = "Verified";
         string retval    = BLL_POLOG_Invoice.POLog_Insert_Invoice(UDFLib.ConvertStringToNull(txtInvoiceID.Text), UDFLib.ConvertIntegerToNull(GetSupplyID()),
                                                                   UDFLib.ConvertStringToNull(ddlType.SelectedValue), UDFLib.ConvertDateToNull(txtInvoiceDate.Text.Trim()), txtReferance.Text.Trim(),
                                                                   UDFLib.ConvertDateToNull(txtReceivedDate.Text.Trim()), UDFLib.ConvertDecimalToNull(txtInvoiceValue.Text.Trim()), ddlCurrency.SelectedValue, UDFLib.ConvertDecimalToNull(txtGST.Text.Trim()),
                                                                   UDFLib.ConvertDateToNull(txtDueDate.Text.Trim()), InvStatus, UDFLib.ConvertDateToNull(txtPaymentDate.Text.Trim()), txtRemarks.Text.Trim(), Status,
                                                                   UDFLib.ConvertToInteger(GetSessionUserID()));
         txtInvoiceID.Text = Convert.ToString(retval);
         int RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(lblInvoiceID.Text), "UNApproved Invoice", "UNApprovedInvoice", UDFLib.ConvertToInteger(GetSessionUserID()));
         //string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
         //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
         BindInvoice();
         string message = "alert('Invoice UN_Approve.')";
         ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
     }
     else if (i == 1)
     {
         string message = "alert('Invoice Value should be negative for credit note Invoice Type.')";
         ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
     }
     else if (i == 2)
     {
         string message = "alert('Invoice and GST value should be positive.')";
         ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
     }
 }
    protected void BindInvoiceCount()
    {
        int    rowcount      = ucCustomPagerItems.isCountRecord;
        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }
        DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Rework_Invoice(Convert.ToInt16(ddlUserName.SelectedValue), sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);

        // objChangeReqstMerge.AddMergedColumns(new int[] { 3, 4 }, "PO", "HeaderStyle-center");
        objChangeReqstMerge.AddMergedColumns(new int[] { 4, 5, 6, 7, 8, 9 }, "Invoice", "HeaderStyle-center");


        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }
        if (ds.Tables[0].Rows.Count > 0)
        {
            gvInvoice.DataSource = ds.Tables[0];
            gvInvoice.DataBind();
        }

        if (ds.Tables[1].Rows.Count > 0)
        {
            gvInvoiceCount.DataSource = ds.Tables[1];
            gvInvoiceCount.DataBind();
        }
    }
Ejemplo n.º 5
0
    protected void btnAddRemarks_Click(object sender, EventArgs e)
    {
        // string html = HtmlEncode(lblBody.Text);
        BLL_POLOG_Invoice.POLOG_Insert_Mail_Details(lblSubject.Text, lblTo.Text, lblCC.Text, lblBody.Text, Convert.ToInt32(GetSessionUserID()));
        string js = "alert('Mail has been sent successfully')";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser", js, true);
    }
Ejemplo n.º 6
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        int transfer_id = Convert.ToInt32(hiddenTransfer.Value);

        BLL_POLOG_Invoice.POLOG_Del_Transfer_Cost(transfer_id, Convert.ToInt32(GetSessionUserID()));
        string msgDraft = String.Format("window.parent.location.reload(true);");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
    }
    protected void btnDeleteInvoice_Click(object sender, EventArgs e)
    {
        string Action = "Delete Invoice";

        BLL_POLOG_Invoice.POLOG_Update_Invoice_Data(Action, hiddenKeyId.Value, txtInvRef.Text, txtInvoiceDate.Text, Convert.ToDouble(txtInvoiceAmount.Text), txtDuedate.Text, txtTo.Text, txtfrom.Text, txtRemarks.Text, "", Convert.ToDouble(50), ViewState["Supplier_Id"].ToString(), null, null, GetSessionUserID());
        string msg2 = String.Format("alert('Invoice data deleted successfully')");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg2, true);
    }
    public void btnDeleteCost_Click(object sender, CommandEventArgs e)
    {
        string[] arg = e.CommandArgument.ToString().Split(',');

        BLL_POLOG_Invoice.POLOG_Del_Transfer_Cost(Convert.ToInt32(UDFLib.ConvertStringToNull(arg[0])), Convert.ToInt32(GetSessionUserID()));
        string msg2 = String.Format("alert('Transfer Cost Deleted.')");

        BindTransferCost();
    }
Ejemplo n.º 9
0
 public void POLOG_UPD_Transfer_Cost()
 {
     try
     {
         BLL_POLOG_Invoice.POLOG_UPD_Transfer_Cost(hiddenTransfer.Value.ToString(), Parent_invoice_id.Value.ToString(), Convert.ToInt32(Parent_Supply_id.Value), Convert.ToInt32(GetSessionUserID()));
     }
     catch
     {
     }
 }
    protected void btnDelete_Click(object s, CommandEventArgs e)
    {
        string[] arg = e.CommandArgument.ToString().Split(',');
        txtInvoiceID.Text = UDFLib.ConvertStringToNull(arg[0]);
        int retval = BLL_POLOG_Invoice.POLog_Delete_Invoice(UDFLib.ConvertStringToNull(txtInvoiceID.Text), UDFLib.ConvertIntegerToNull(txtPOCode.Text), UDFLib.ConvertToInteger(GetSessionUserID()));

        BindInvoiceDetails();

        string Action      = "Delete Invoice";
        string Description = "DeleteInvoice";
        int    RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(txtInvoiceID.Text), Action, Description, UDFLib.ConvertToInteger(GetSessionUserID()));
    }
Ejemplo n.º 11
0
 protected string Save(string Status)
 {
     try
     {
         string transfer_id = BLL_POLOG_Invoice.POLOG_INS_Transfer_Cost(UDFLib.ConvertToInteger(Parent_Supply_id.Value), Parent_invoice_id.Value, UDFLib.ConvertToInteger(GetSessionUserID()), hiddenTransfer.Value, Status, Convert.ToDouble(txtAmount.Text),
                                                                        Convert.ToInt32(ddlVessel.SelectedValue), txtRemarks.Text, ddlAccClassification.SelectedValue, ddlOwnerCode.SelectedValue);
         return(transfer_id);
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 12
0
    protected void BindApprovedInvoiceGrid()
    {
        try
        {
            int rowcount = ucCustomPager2.isCountRecord;
            objChangeReqstMerge.AddMergedColumns(new int[] { 2, 3, 4 }, "PO", "HeaderStyle-center");
            objChangeReqstMerge.AddMergedColumns(new int[] { 5, 6, 7, 8, 9, 10, 11, 12, 13 }, "Invoice", "HeaderStyle-center");
            objChangeReqstMerge.AddMergedColumns(new int[] { 14, 15 }, "Final Approver", "HeaderStyle-center");

            DataTable dtType        = ChkType();
            string    InvoiceStatus = "Approved";


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

            DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Final_Invoice_Search(UDFLib.ConvertStringToNull(ddlSupplier.SelectedValue),
                                                                          UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), InvoiceStatus, dtType, UDFLib.ConvertIntegerToNull(GetSessionUserID()), sortbycoloumn, sortdirection
                                                                          , ucCustomPager2.CurrentPageIndex, ucCustomPager2.PageSize, ref rowcount);


            if (ucCustomPager2.isCountRecord == 1)
            {
                ucCustomPager2.CountTotalRec = rowcount.ToString();
                ucCustomPager2.BuildPager();
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                btnUnApprove.Visible         = true;
                divApprovedPayment.Visible   = true;
                divPendingInvoice.Visible    = false;
                gvApprovedInvoice.DataSource = ds.Tables[0];
                gvApprovedInvoice.DataBind();
            }
            else
            {
                divApprovedPayment.Visible   = false;
                btnUnApprove.Visible         = false;
                divPendingInvoice.Visible    = false;
                gvApprovedInvoice.DataSource = ds.Tables[0];
                gvApprovedInvoice.DataBind();
            }
        }
        catch { }
        {
        }
    }
Ejemplo n.º 13
0
 protected void btnCTM_Click(object sender, EventArgs e)
 {
     try
     {
         string InvStatus   = "CTM";
         int    retval      = BLL_POLOG_Invoice.POLog_Update_CTM_Invoice(UDFLib.ConvertStringToNull(txtInvoiceID.Text), InvStatus, UDFLib.ConvertToInteger(GetSessionUserID()));
         int    RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(lblInvoiceID.Text), "CTM Invoice", "CTMInvoice", UDFLib.ConvertToInteger(GetSessionUserID()));
         string message     = "alert('Invoice and Payment Updated Successfully of CTM Transaction.')";
         ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
         BindInvoice();
     }
     catch { }
     {
     }
 }
Ejemplo n.º 14
0
    protected void btnPaymentRevoke_Click(object sender, EventArgs e)
    {
        try
        {
            string RevokeType = "PaymentApproval";
            int    retval     = BLL_POLOG_Invoice.POLog_Revoke_Payment_Invoice(UDFLib.ConvertStringToNull(txtInvoiceID.Text), RevokeType, UDFLib.ConvertToInteger(GetSessionUserID()));

            string message = "alert('Invoice and Payment Updated Successfully of CTM Transaction.')";
            ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
            BindInvoice();
        }
        catch { }
        {
        }
    }
Ejemplo n.º 15
0
    protected void BindOnlineInvoice()
    {
        try
        {
            objChangeReqstMerge.AddMergedColumns(new int[] { 2, 3, 4, 5, 6, 7 }, "PO Details", "HeaderStyle-center");
            objChangeReqstMerge.AddMergedColumns(new int[] { 9, 10, 11, 12, 13, 14 }, "Online Invoice", "HeaderStyle-center");
            int rowcount = ucCustomPager1.isCountRecord;

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

            DataSet ds = BLL_POLOG_Invoice.POLOG_Get_PedingOnline_Invoice(txtfilter.Text.Trim() != "" ? txtfilter.Text.Trim() : null, GetSessionUserID(),
                                                                          sortbycoloumn, sortdirection
                                                                          , ucCustomPager1.CurrentPageIndex, ucCustomPager1.PageSize, ref rowcount);

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

            if (ds.Tables[0].Rows.Count > 0)
            {
                gvOnlineInvoice.DataSource = ds.Tables[0];
                gvOnlineInvoice.DataBind();
            }
            else
            {
                gvOnlineInvoice.DataSource = null;
                gvOnlineInvoice.DataBind();
                gvExistingInvoices.DataSource = null;
                gvExistingInvoices.DataBind();
                gvDuplieCateinvoice.DataSource = null;
                gvDuplieCateinvoice.DataBind();
            }
        }
        catch { }
        {
        }
    }
    protected void BindInvoiceDetails()
    {
        try
        {
            int rowcount = ucCustomPagerItems.isCountRecord;

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

            DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Invoice_List(txtfilter.Text.Trim() != "" ? txtfilter.Text.Trim() : null, UDFLib.ConvertIntegerToNull(txtPOCode.Text), GetSessionUserID(),
                                                                  sortbycoloumn, sortdirection
                                                                  , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);
            if (ucCustomPagerItems.isCountRecord == 1)
            {
                ucCustomPagerItems.CountTotalRec = rowcount.ToString();
                ucCustomPagerItems.BuildPager();
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                DivInvoiceDeatils.Visible   = true;
                gvInvoiceDetails.DataSource = ds.Tables[0];
                gvInvoiceDetails.DataBind();
                txtInvoiceID.Text                  = ds.Tables[0].Rows[0]["Invoice_ID"].ToString();
                Session["Invoice_Amount"]          = ds.Tables[0].Rows[0]["Invoice_Amount"].ToString();
                gvInvoiceDetails.Rows[0].BackColor = System.Drawing.Color.Yellow;
                BindTransferCost();
                ViewState["TId"] = txtInvoiceID.Text;
            }
            else
            {
                DivInvoiceDeatils.Visible   = false;
                gvInvoiceDetails.DataSource = ds.Tables[0];
                gvInvoiceDetails.DataBind();
            }
        }
        catch { }
        {
        }
    }
Ejemplo n.º 17
0
    protected void BindUser()
    {
        try
        {
            DataTable dt = BLL_POLOG_Invoice.Get_Invoice_UserList(Convert.ToInt32(Session["USERID"].ToString())).Tables[0];
            ddlUserName.DataSource     = dt;
            ddlUserName.DataTextField  = "For_Action_By";
            ddlUserName.DataValueField = "UserID";
            ddlUserName.DataBind();

            if (ddlUserName.Items.FindByValue(Convert.ToString(GetSessionUserID())) != null)
            {
                ddlUserName.SelectedValue = Convert.ToString(GetSessionUserID());
            }
            ViewState["UserID"] = ddlUserName.SelectedValue;
            BindInvoiceCount();
        }
        catch { }
        {
        }
    }
Ejemplo n.º 18
0
    protected void BindSupplierDetails()
    {
        try
        {
            string supply_Id = "15003680";

            //DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Supplier_Deatils(UDFLib.ConvertIntegerToNull(Request.QueryString["ID"].ToString()), UDFLib.ConvertIntegerToNull(GetSessionUserID()));
            DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Supplier_Deatils(UDFLib.ConvertIntegerToNull(supply_Id), UDFLib.ConvertIntegerToNull(GetSessionUserID()));

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Email"].ToString()))
                {
                    ViewState["TO"] = ds.Tables[0].Rows[0]["Email"].ToString() + ";" + ds.Tables[0].Rows[0]["Contact_1_Email"].ToString();
                }
                else
                {
                    ViewState["TO"] = ds.Tables[0].Rows[0]["Contact_1_Email"].ToString();
                }
                ViewState["PassCode"] = ds.Tables[0].Rows[0]["PassCode"].ToString();
            }

            if (ds.Tables[1].Rows.Count > 0)
            {
            }

            if (ds.Tables[2].Rows.Count > 0)
            {
                ViewState["PO"] = ds.Tables[2].Rows[0]["Office_Ref_Code"].ToString();
            }

            if (ds.Tables[3].Rows.Count > 0)
            {
                ViewState["CC"] = ds.Tables[3].Rows[0]["MailId"].ToString();
            }
        }
        catch { }
        {
        }
    }
    protected void BindOnlineInvoice()
    {
        try
        {
            int rowcount = ucCustomPager1.isCountRecord;

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

            DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Online_Invoice(txtfilter.Text.Trim() != "" ? txtfilter.Text.Trim() : null, UDFLib.ConvertIntegerToNull(txtPOCode.Text), GetSessionUserID(),
                                                                    sortbycoloumn, sortdirection
                                                                    , ucCustomPager1.CurrentPageIndex, ucCustomPager1.PageSize, ref rowcount);

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

            if (ds.Tables[0].Rows.Count > 0)
            {
                divOnlineInvoice.Visible   = true;
                gvOnlineInvoice.DataSource = ds.Tables[0];
                gvOnlineInvoice.DataBind();
            }
            else
            {
                divOnlineInvoice.Visible   = false;
                gvOnlineInvoice.DataSource = ds.Tables[0];
                gvOnlineInvoice.DataBind();
            }
        }
        catch { }
        {
        }
    }
Ejemplo n.º 20
0
    protected void BindInvoiceDetails()
    {
        try
        {
            int rowcount = ucCustomPagerItems.isCountRecord;

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

            DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Invoice_List(null, UDFLib.ConvertIntegerToNull(ViewState["Supplier_Id"]), GetSessionUserID(),
                                                                  sortbycoloumn, sortdirection
                                                                  , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);
            if (ucCustomPagerItems.isCountRecord == 1)
            {
                ucCustomPagerItems.CountTotalRec = rowcount.ToString();
                ucCustomPagerItems.BuildPager();
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                divExistingInvoices.Visible   = true;
                gvExistingInvoices.DataSource = ds.Tables[0];
                gvExistingInvoices.DataBind();

                gvExistingInvoices.Rows[0].BackColor = System.Drawing.Color.Yellow;
            }
            else
            {
                divExistingInvoices.Visible   = false;
                gvExistingInvoices.DataSource = ds.Tables[0];
                gvExistingInvoices.DataBind();
            }
        }
        catch { }
        {
        }
    }
Ejemplo n.º 21
0
 protected void BindAttachment(string Invoice_ID)
 {
     try
     {
         string  InvoiceType = "Invoice";
         DataSet ds          = BLL_POLOG_Invoice.POLOG_Get_Invoice_Attachments(Invoice_ID, InvoiceType);
         if (ds.Tables[0].Rows.Count > 0)
         {
             //string FilePath = ds.Tables[0].Rows[0]["FILE_NAME"].ToString();
             string SavePath = ("../Uploads/Files_Uploaded");
             string File_ID  = ds.Tables[0].Rows[0]["Id"].ToString();
             //string filePath = "../Uploads/POLog/" + ds.Tables[0].Rows[0]["FILE_NAME"].ToString();
             File_ID = File_ID.PadLeft(8, '0');
             string F1 = Mid(File_ID, 0, 2);
             string F2 = Mid(File_ID, 2, 2);
             string F3 = Mid(File_ID, 4, 2);
             // string filePath = SavePath + "/" + F1 + "/" + F2 + "/" + F3 + "/" + ds.Tables[0].Rows[0]["File_Path"].ToString();
             string filePath = SavePath + "\\" + F1 + "\\" + F2 + "\\" + F3 + "\\" + File_ID + "" + Path.GetExtension(ds.Tables[0].Rows[0]["FILE_NAME"].ToString());
             if (filePath != "")
             {
                 Random r   = new Random();
                 string ver = r.Next().ToString();
                 IframeInvoice.Attributes.Add("src", filePath + "?ver=" + ver);
             }
         }
         if (ds.Tables[1].Rows.Count > 0)
         {
             lblPO.Text = ds.Tables[1].Rows[0]["Po_Remarks"].ToString();
         }
         if (ds.Tables[2].Rows.Count > 0)
         {
             lblInvoice.Text = ds.Tables[2].Rows[0]["Invoice_Remarks"].ToString();
         }
     }
     catch { }
     {
     }
 }
    protected void BindTransferCost2()
    {
        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());
            }
            string Invoice_ID = ViewState["TId"].ToString();

            //change
            //Invoice_ID = "73612";
            //txtPOCode.Text = "19779";

            DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Invoice_Transfer_Cost(Invoice_ID, UDFLib.ConvertIntegerToNull(txtPOCode.Text), GetSessionUserID());

            if (ds.Tables[0].Rows.Count > 0)
            {
                dvTransferCost.Visible    = true;
                gvTransferCost.DataSource = ds.Tables[0];
                gvTransferCost.DataBind();
                gvTransferCost.Visible = true;
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", InvoiceAmount.Value, true);
            }
            else
            {
                //gvTransferCost.Visible = false;
                gvTransferCost.DataSource = null;
                gvTransferCost.DataBind();
            }
        }
        catch { }
        {
        }
    }
Ejemplo n.º 23
0
    protected void BindInvoice()
    {
        DataSet ds = BLL_POLOG_Invoice.POLOG_Get_Invoice_Details(UDFLib.ConvertStringToNull(txtInvoiceID.Text), GetSessionUserID());

        if (ds.Tables[0].Rows.Count > 0)
        {
            lblInvoiceID.Text = ds.Tables[0].Rows[0]["Invoice_ID"].ToString();
            lblJournal.Text   = ds.Tables[0].Rows[0]["Journal_ID"].ToString();
            txtInvoiceID.Text = ds.Tables[0].Rows[0]["Invoice_ID"].ToString();

            ddlType.SelectedValue     = ds.Tables[0].Rows[0]["Invoice_Type"].ToString();
            txtInvoiceDate.Text       = ds.Tables[0].Rows[0]["Invoice_Date"].ToString();
            txtReferance.Text         = ds.Tables[0].Rows[0]["Invoice_Reference"].ToString();
            txtReceivedDate.Text      = ds.Tables[0].Rows[0]["Received_Date"].ToString();
            txtInvoiceValue.Text      = ds.Tables[0].Rows[0]["Invoice_Amount"].ToString();
            ddlCurrency.SelectedValue = ds.Tables[0].Rows[0]["Invoice_Currency"].ToString();
            txtGST.Text              = ds.Tables[0].Rows[0]["Invoice_GST_Amount"].ToString();
            txtDueDate.Text          = ds.Tables[0].Rows[0]["Invoice_Due_Date"].ToString();
            txtInvStatus.Text        = ds.Tables[0].Rows[0]["Invoice_Status"].ToString();
            txtPaymentDate.Text      = ds.Tables[0].Rows[0]["Payment_Due_Date"].ToString();
            txtRemarks.Text          = ds.Tables[0].Rows[0]["Discrepancies_Remarks"].ToString();
            lblVerificationDate.Text = ds.Tables[0].Rows[0]["Verified_Date"].ToString();
            if (ds.Tables[0].Rows[0]["Verified_Date"].ToString() == "")
            {
                lblPendingApproval.Text = "Pending Approval By :";
                //lblApproval.Text = "Approval Limit has not assigned for this Invoice.";
                lblApproval.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                lblPendingApproval.Text = "Pending approval by :";
                if (ds.Tables[0].Rows[0]["Req_Type"].ToString() == "OXP")
                {
                    lblApproval.Text = "Invoices for Owners Expenses are approved in the Charter Hire Module. Please inform Chartering Dept.";
                }
                else
                {
                    if (ds.Tables[0].Rows[0]["Invoice_Approvers"].ToString() != "")
                    {
                        lblApproval.Text = ds.Tables[0].Rows[0]["Invoice_Approvers"].ToString();
                    }
                    else
                    {
                        lblApproval.Text = "Approval Limit has not assigned for this Invoice.";
                    }
                    lblApproval.ForeColor = System.Drawing.Color.Red;
                }
            }
            //lblApprovalDate.Text = ds.Tables[0].Rows[0]["Approved_Date"].ToString();
            lblverification.Text = ds.Tables[0].Rows[0]["Verify_By"].ToString();

            lblAction.Text = ds.Tables[0].Rows[0]["Action_By"].ToString();
            if (ds.Tables[0].Rows[0]["Urgent_Flag"].ToString() == "YES")
            {
                lblUrgent.ForeColor = System.Drawing.Color.Red;
                lblUrgent.Text      = ds.Tables[0].Rows[0]["Urgent_Flag"].ToString();
                btnUrgent.Text      = "Not Urgent";
            }
            else
            {
                lblUrgent.ForeColor = System.Drawing.Color.Blue;
                lblUrgent.Text      = "No";
                btnUrgent.Text      = "Urgent";
            }
            lblPayment.Text       = ds.Tables[0].Rows[0]["Payment_Priority"].ToString();
            btnCancel.Visible     = true;
            btnVerified.Visible   = true;
            btnAttachment.Visible = true;
            if (ds.Tables[0].Rows[0]["Invoice_Status"].ToString() == "Received")
            {
                //btnSave.Enabled = false;
                btnCancel.Enabled     = true;
                btnUnVerified.Visible = false;
                btnVerified.Visible   = true;
                btnApprove.Visible    = false;
                btnUnApprove.Visible  = false;
            }
            if (ds.Tables[0].Rows[0]["Invoice_Status"].ToString() == "Verified")
            {
                if (ds.Tables[0].Rows[0]["Invoice_Type"].ToString() == "ADVANCE")
                {
                    ddlType.Enabled = false;
                }
                EnableDisable(false);
                btnCTM.Visible = true;
                if (ds.Tables[0].Rows[0]["For_Approver"].ToString() == "Yes")
                {
                    btnApprove.Visible    = true;
                    btnUnVerified.Visible = false;
                    btnCancel.Visible     = false;
                    btnVerified.Visible   = false;
                    btnSave.Visible       = false;
                    btnUnApprove.Visible  = false;
                }
                if (ds.Tables[0].Rows[0]["Verified_By"].ToString() != "")
                {
                    btnUnVerified.Visible = true;
                    btnCancel.Visible     = false;
                    btnVerified.Visible   = false;
                    btnSave.Visible       = false;
                }
                else
                {
                    btnUnVerified.Visible = false;
                    btnCancel.Visible     = true;
                    btnVerified.Visible   = true;
                    btnSave.Visible       = true;
                }
            }
            if (ds.Tables[0].Rows[0]["Invoice_Status"].ToString() == "Approved")
            {
                lblPendingApproval.Text = "Approved By :";
                lblApproval.Text        = ds.Tables[0].Rows[0]["Approve_By"].ToString();
                lblApprovalDate.Text    = ds.Tables[0].Rows[0]["Approved_Date"].ToString();
                btnApprove.Visible      = false;
                btnUnVerified.Visible   = false;
                btnCancel.Visible       = false;
                btnVerified.Visible     = false;
                btnSave.Visible         = false;
                btnCTM.Visible          = false;
                btnUrgent.Visible       = false;
                btnAttachment.Visible   = false;
                btnUnApprove.Visible    = false;
                EnableDisable(false);
            }
            if (ds.Tables[0].Rows[0]["Invoice_Status"].ToString() == "Approved" && ds.Tables[0].Rows[0]["Approve_By"].ToString() == GetSessionUserName())
            {
                btnUnApprove.Visible = true;
            }
            if (ds.Tables[0].Rows[0]["Invoice_Status"].ToString() == "CANCELLED")
            {
                btnApprove.Enabled    = false;
                btnUnVerified.Enabled = false;
                btnCancel.Enabled     = false;
                btnVerified.Enabled   = false;
                btnSave.Enabled       = false;
                btnUnApprove.Enabled  = true;
                lblHeadermsg.Visible  = true;
                lblHeadermsg.Text     = "Invoice Cancelled";
            }
        }
    }