Esempio n. 1
0
    protected void lbtnEdit_Click(object s, CommandEventArgs e)
    {
        string[] arg       = e.CommandArgument.ToString().Split(',');
        int?     RemarksID = UDFLib.ConvertIntegerToNull(arg[0]);

        txtRemarksID.Text = UDFLib.ConvertStringToNull(arg[0]);
        DataTable dt           = new DataTable();
        int       Type         = 1;
        String    Remarks_Type = Request.QueryString["Type"].ToString();

        dt = BLL_POLOG_Register.POLOG_Get_Remarks(UDFLib.ConvertIntegerToNull(txtRemarksID.Text), UDFLib.ConvertIntegerToNull(txtPOCode.Text.ToString()), Type, Remarks_Type);
        if (dt.Rows.Count > 0)
        {
            DataRow dr = dt.Rows[0];
            txtAddRemarks.Text = dr["Remarks"].ToString();
            btnAddRemarks.Text = "Edit Remarks";
        }
    }
Esempio n. 2
0
    protected void Update_Final_Invoice(string InvStatus, string Status)
    {
        DataTable dt = new DataTable();

        dt.Columns.Add("PKID");
        dt.Columns.Add("ChkValue");
        dt.Columns.Add("Invoice_ID");
        int i = 0;

        DataRow dr = dt.NewRow();

        dr["PKID"]       = i + 1;
        dr["ChkValue"]   = 1;
        dr["Invoice_ID"] = txtInvoiceCode.Text.ToString();
        dt.Rows.Add(dr);
        int Ret = BLL_POLOG_Register.POLog_Update_Invoice(dt, InvStatus, Status, UDFLib.ConvertToInteger(GetSessionUserID()));
        //int retval = BLL_POLOG_Register.POLog_Update_Invoice(dt, InvStatus, Status, UDFLib.ConvertToInteger(GetSessionUserID()));
    }
Esempio n. 3
0
    public void BindAcct()
    {
        DataSet ds1 = BLL_POLOG_Register.POLOG_Get_AccountClassification(UDFLib.ConvertIntegerToNull(GetSessionUserID()), ddlPOType.SelectedValue);

        ddlAccClassifictaion.DataSource     = ds1.Tables[0];
        ddlAccClassifictaion.DataTextField  = "VARIABLE_NAME";
        ddlAccClassifictaion.DataValueField = "VARIABLE_CODE";
        ddlAccClassifictaion.DataBind();
        ddlAccClassifictaion.Items.Insert(0, new ListItem("-All-", "0"));


        //DataSet ds2 = BLL_POLOG_Register.POLOG_Get_AccountClassification(UDFLib.ConvertIntegerToNull(GetSessionUserID()), ddlPOType.SelectedValue);
        ddlGroupName.DataSource     = ds1.Tables[1];
        ddlGroupName.DataTextField  = "Approval_Group_Name";
        ddlGroupName.DataValueField = "Approval_Group_Code";
        ddlGroupName.DataBind();
        ddlGroupName.Items.Insert(0, new ListItem("-All-", "0"));
    }
    protected void BindDropDownList()
    {
        DataSet ds = BLL_POLOG_Register.POLOG_Get_Type(UDFLib.ConvertToInteger(GetSessionUserID()), "ALL_SUPPLIER");

        ddlSupplier.DataSource     = ds.Tables[0];
        ddlSupplier.DataTextField  = "Supplier_Name";
        ddlSupplier.DataValueField = "Supplier_Code";
        ddlSupplier.DataBind();
        ddlSupplier.Items.Insert(0, new ListItem("-All Suppliers-", "0"));

        DataSet dsOwner = BLL_POLOG_Register.POLOG_Get_Type(UDFLib.ConvertToInteger(GetSessionUserID()), "OWNER");

        ddlOwner.DataSource     = dsOwner.Tables[0];
        ddlOwner.DataTextField  = "Supplier_Name";
        ddlOwner.DataValueField = "Supplier_Code";
        ddlOwner.DataBind();
        ddlOwner.Items.Insert(0, new ListItem("-All Owners-", "0"));
    }
    protected void BindWithholdInvoice()
    {
        try
        {
            int    rowcount      = ucCustomPager3.isCountRecord;
            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }
            string InvoiceStatus = (ViewState["InvoiceStatus"] == null) ? null : (ViewState["InvoiceStatus"].ToString());

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


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

            if (ds.Tables[0].Rows.Count > 0)
            {
                dvWithhold.Visible      = true;
                gvPOWithhold.DataSource = ds.Tables[0];
                gvPOWithhold.DataBind();
                txtPOCode.Text = ds.Tables[0].Rows[0]["SUPPLY_ID"].ToString();
                BindInvoice(ds.Tables[0].Rows[0]["SUPPLY_ID"].ToString());
                gvPOWithhold.Rows[0].BackColor = System.Drawing.Color.Yellow;
            }
            else
            {
                dvWithhold.Visible      = false;
                gvPOWithhold.DataSource = ds.Tables[0];
                gvPOWithhold.DataBind();
            }
        }
        catch { }
        {
        }
    }
Esempio n. 6
0
    protected void BindGrid()
    {
        DataTable dt = BLL_POLOG_Register.POLOG_Get_Invoice(UDFLib.ConvertIntegerToNull(txtPOCode.Text.ToString()));

        if (dt.Rows.Count > 0)
        {
            divPendingPO.Visible = true;
            gvInvoice.DataSource = dt;
            gvInvoice.DataBind();
            BindAttachment(UDFLib.ConvertStringToNull(dt.Rows[0]["Invoice_ID"].ToString()));
            BindPoPreview(UDFLib.ConvertStringToNull(dt.Rows[0]["Supply_ID"].ToString()));
        }
        else
        {
            divPendingPO.Visible = false;
            gvInvoice.DataSource = dt;
            gvInvoice.DataBind();
        }
    }
Esempio n. 7
0
    public void BindDropDownList()
    {
        DataTable dt = objBLL.Get_VesselList(0, 0, 0, "", Convert.ToInt32(GetCompanyID()));


        ddlVessel.DataSource     = dt;
        ddlVessel.DataTextField  = "VESSEL_NAME";
        ddlVessel.DataValueField = "VESSEL_ID";
        ddlVessel.DataBind();
        ddlVessel.Items.Insert(0, new ListItem("-All Vessels-", "0"));

        DataSet ds = BLL_POLOG_Register.POLOG_Get_Type(UDFLib.ConvertToInteger(GetSessionUserID()), "ALL_SUPPLIER");

        ddlSupplier.DataSource     = ds.Tables[0];
        ddlSupplier.DataTextField  = "Supplier_Name";
        ddlSupplier.DataValueField = "Supplier_Code";
        ddlSupplier.DataBind();
        ddlSupplier.Items.Insert(0, new ListItem("-All Suppliers-", "0"));
    }
Esempio n. 8
0
    protected void btnUrgent_Click(object sender, EventArgs e)
    {
        string Status    = null;
        string InvStatus = null;

        if (btnUrgent.Text == "Urgent")
        {
            Status    = "Urgent";
            InvStatus = "Urgent";
            int RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(lblInvoiceID.Text), "NON Urgent Invoice", "UNUrgentInvoice", UDFLib.ConvertToInteger(GetSessionUserID()));
        }
        else
        {
            Status    = "UNUrgent";
            InvStatus = "UNUrgent";
            int RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(lblInvoiceID.Text), "Urgent Invoice", "UrgentInvoice", UDFLib.ConvertToInteger(GetSessionUserID()));
        }
        Update_Invoice(Status, InvStatus);
    }
    public void Load_dropdownlist()
    {
        string  SearchType = "PAYMENT";
        DataSet ds         = BLL_POLOG_Register.POLOG_Get_Supplier_InvoiceWise(UDFLib.ConvertIntegerToNull(GetSessionUserID()), SearchType);

        if (ds.Tables[0].Rows.Count > 0)
        {
            ddlSupplier.DataSource     = ds.Tables[0];
            ddlSupplier.DataTextField  = "Supplier_Name";
            ddlSupplier.DataValueField = "Supplier_Code";
            ddlSupplier.DataBind();
            ddlSupplier.Items.Insert(0, new ListItem("-All-", "0"));
        }
        else
        {
            ddlSupplier.Items.Insert(0, new ListItem("-All-", "0"));
        }
        if (ds.Tables[1].Rows.Count > 0)
        {
            ddlVessel.DataSource     = ds.Tables[1];
            ddlVessel.DataTextField  = "Vessel_Name";
            ddlVessel.DataValueField = "Vessel_ID";
            ddlVessel.DataBind();
            ddlVessel.Items.Insert(0, new ListItem("-All-", "0"));
        }
        else
        {
            ddlVessel.Items.Insert(0, new ListItem("-All-", "0"));
        }
        if (ds.Tables[2].Rows.Count > 0)
        {
            ddlOwner.DataSource     = ds.Tables[2];
            ddlOwner.DataTextField  = "Owner_Name";
            ddlOwner.DataValueField = "Owner_Code";
            ddlOwner.DataBind();
            ddlOwner.Items.Insert(0, new ListItem("-All-", "0"));
        }
        else
        {
            ddlOwner.Items.Insert(0, new ListItem("-All-", "0"));
        }
    }
Esempio n. 10
0
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        try
        {
            string DocType = "Invoice";
            //string savePath = Server.MapPath("\\" + System.Configuration.ConfigurationManager.AppSettings["APP_NAME"].ToString() + "\\Uploads\\Files_Uploaded");
            Guid GUID = Guid.NewGuid();

            string Flag_Attach = GUID.ToString() + Path.GetExtension(FileUpload1.FileName);


            string OCA_URL = null;
            if (!Request.Url.AbsoluteUri.Contains(ConfigurationManager.AppSettings["OCA_APP_URL"]))
            {
                OCA_URL = ConfigurationManager.AppSettings["OCA_APP_URL"];
            }
            string OCA_URL1 = OCA_URL + @"\Files_Uploaded";


            string savePath = (OCA_URL1);

            string FileID = BLL_POLOG_Register.POLOG_Insert_AttachedFile(UDFLib.ConvertStringToNull(lblInvoiceID.Text), Path.GetExtension(FileUpload1.FileName),
                                                                         UDFLib.Remove_Special_Characters(Path.GetFileName(FileUpload1.FileName)), Flag_Attach, DocType, 2714);

            FileID = FileID.PadLeft(8, '0');
            string F1 = Mid(FileID, 0, 2);
            string F2 = Mid(FileID, 2, 2);
            string F3 = Mid(FileID, 4, 2);
            if (!Directory.Exists(savePath + "\\" + F1 + "\\" + F2 + "\\" + F3))
            {
                Directory.CreateDirectory(savePath + "\\" + F1 + "\\" + F2 + "\\" + F3);
            }

            string filePath = savePath + "\\" + F1 + "\\" + F2 + "\\" + F3 + "\\" + FileID + "" + Path.GetExtension(FileUpload1.FileName);
            FileUpload1.SaveAs(filePath);
            // int RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(lblInvoiceID.Text), "Uploaded Invoice", "UploadedInvoice", 2714);
            BindReqsnAttchment();
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 11
0
    protected void PaymentDet()
    {
        DataSet ds = BLL_POLOG_Register.POLOG_Get_Payment_Details(txtPaymodeID.Text.ToString(), txtSupplierCode.Text.ToString(), UDFLib.ConvertIntegerToNull(txtPayment_Year.Text), GetSessionUserID());

        if (ds.Tables[0].Rows.Count > 0)
        {
            txtPaymentAmount.Text    = ds.Tables[0].Rows[0]["PAYMENT_AMOUNT"].ToString();
            txtBankRef.Text          = ds.Tables[0].Rows[0]["BANK_REFERENCE"].ToString();
            txtPayDate.Text          = ds.Tables[0].Rows[0]["PAYMENT_DATE"].ToString();
            ddlPayMode.SelectedValue = ds.Tables[0].Rows[0]["PAYMENT_MODE"].ToString();
            rdbPaymode.SelectedValue = ds.Tables[0].Rows[0]["Payment_Status"].ToString();
            ddlAccount.Text          = ds.Tables[0].Rows[0]["Bank_Account_ID"].ToString();
            txtBankAmt.Text          = ds.Tables[0].Rows[0]["Bank_Amount"].ToString();
            txtBankCharge.Text       = ds.Tables[0].Rows[0]["Bank_Charges"].ToString();
            txtRemarks.Text          = ds.Tables[0].Rows[0]["PAYMENT_REMARKS"].ToString();
            txtJournal.Text          = ds.Tables[0].Rows[0]["Journal_ID"].ToString();
            txtPaymodeID.Text        = ds.Tables[0].Rows[0]["PAYMENT_ID"].ToString();
            txtPayment_Year.Text     = ds.Tables[0].Rows[0]["PAYMENT_YEAR"].ToString();
        }
    }
Esempio n. 12
0
 void BindGroupDeatils(string GroupID)
 {
     try
     {
         //Change And Enter One Type
         int Type = 1;
         //DataSet ds = BLL_POLOG_Lib.Get_Approval_Group(GroupID, Type);
         DataSet ds = BLL_POLOG_Register.POLOG_Get_AccountClassification(UDFLib.ConvertIntegerToNull(GetSessionUserID()), null);
         if (ds.Tables[1].Rows.Count > 0)
         {
             txtApprovalGroup.Text   = ds.Tables[0].Rows[0]["Approval_Group_Name"].ToString();
             txtGroupID.Text         = ds.Tables[0].Rows[0]["Approval_Group_Code"].ToString();
             ddlPOType.SelectedValue = ds.Tables[0].Rows[0]["Req_type"].ToString();
         }
         BindDepartmentList(txtGroupID.Text, ddlPOType.SelectedValue);
     }
     catch { }
     {
     }
 }
Esempio n. 13
0
    public void BindReqsnAttchment()
    {
        string    DocType      = "Invoice";
        DataTable dtAttachment = BLL_POLOG_Register.POLOG_Get_Attachments(UDFLib.ConvertStringToNull(lblInvoiceID.Text), DocType);

        if (dtAttachment.Rows.Count > 0)
        {
            string FilePath = dtAttachment.Rows[0]["File_Path"].ToString();
            divAttachment.Visible        = true;
            gvReqsnAttachment.DataSource = dtAttachment;
            gvReqsnAttachment.DataBind();
            BindAttchement(hdnFilePath.Value);
        }
        else
        {
            divAttachment.Visible        = false;
            gvReqsnAttachment.DataSource = dtAttachment;
            gvReqsnAttachment.DataBind();
        }
    }
Esempio n. 14
0
    protected void Update_Invoice(string InvStatus, string Status)
    {
        DataTable dt = new DataTable();

        dt.Columns.Add("PKID");
        dt.Columns.Add("ChkValue");
        dt.Columns.Add("Invoice_ID");
        int i = 0;

        if (InvStatus == "Approved")
        {
            foreach (GridViewRow row in gvPendingInvoice.Rows)
            {
                bool result = ((CheckBox)row.FindControl("chkInvoice")).Checked;
                if (result)
                {
                    DataRow dr = dt.NewRow();
                    dr["PKID"]       = i + 1;
                    dr["ChkValue"]   = 1;
                    dr["Invoice_ID"] = gvPendingInvoice.DataKeys[row.RowIndex].Value.ToString();
                    dt.Rows.Add(dr);
                }
            }
        }
        else
        {
            foreach (GridViewRow row in gvApprovedInvoice.Rows)
            {
                bool result = ((CheckBox)row.FindControl("chkInvoice")).Checked;
                if (result)
                {
                    DataRow dr = dt.NewRow();
                    dr["PKID"]       = i + 1;
                    dr["ChkValue"]   = 1;
                    dr["Invoice_ID"] = gvApprovedInvoice.DataKeys[row.RowIndex].Value.ToString();
                    dt.Rows.Add(dr);
                }
            }
        }
        int retval = BLL_POLOG_Register.POLog_Update_Invoice(dt, InvStatus, Status, UDFLib.ConvertToInteger(GetSessionUserID()));
    }
Esempio n. 15
0
    protected void BindPODetails()
    {
        try
        {
            DataSet ds = BLL_POLOG_Register.POLOG_Get_PO_Deatils(UDFLib.ConvertIntegerToNull(Parent_Supply_id.Value), null, UDFLib.ConvertIntegerToNull(GetSessionUserID()));

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr = ds.Tables[0].Rows[0];


                if (ddlVessel.Items.FindByValue(dr["Vessel_ID"].ToString()) != null)
                {
                    ddlVessel.SelectedValue = dr["Vessel_ID"].ToString();
                }
            }
        }
        catch { }
        {
        }
    }
 protected void Save(string Status)
 {
     try
     {
         string responseid = BLL_POLOG_Register.POLOG_INS_Batch_Payment(UDFLib.ConvertStringToNull(txtPaymentID.Text), ddlSupplierName.SelectedValue, ddlPaymentType.SelectedValue, ddlPaymentCurrency.SelectedValue,
                                                                        txtBankName.Text, ddlCountry.SelectedValue, ddlState.SelectedValue, txtSwiftCode.Text.Trim(), txtABANumber.Text.Trim(), txtBankCode.Text.Trim(), txtBranchCode.Text.Trim(), txtAccountNumber.Text.Trim(),
                                                                        txtBeneficiary.Text.Trim(), ddlPaymentAccount.SelectedValue, ddlPayMode.SelectedValue, UDFLib.ConvertIntegerToNull(Session["USERID"]), "DRAFT");
         txtPaymentID.Text = Convert.ToString(responseid);
         if (responseid != "0")
         {
             string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
             ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
         }
         else
         {
         }
     }
     catch { }
     {
     }
 }
Esempio n. 17
0
    protected void BindSupplier()
    {
        DataTable dt = BLL_POLOG_Register.POLOG_Get_Supplier(ddlSupplierType.SelectedValue);

        if (dt.Rows.Count > 0)
        {
            ddlSupplier.DataSource     = dt;
            ddlSupplier.DataTextField  = "Supplier_Name";
            ddlSupplier.DataValueField = "Supplier_Code";
            ddlSupplier.DataBind();
            ddlSupplier.Items.Insert(0, new ListItem("-All-", "0"));
        }
        else
        {
            ddlSupplier.DataSource     = dt;
            ddlSupplier.DataTextField  = "Supplier_Name";
            ddlSupplier.DataValueField = "Supplier_Code";
            ddlSupplier.DataBind();
            ddlSupplier.Items.Insert(0, new ListItem("-All-", "0"));
        }
    }
    protected void BindType()
    {
        try
        {
            DataSet ds = BLL_POLOG_Register.POLOG_Get_Type(UDFLib.ConvertToInteger(Session["UserID"].ToString()), "PO_TYPE");
            chkType.DataSource     = ds.Tables[0];
            chkType.DataTextField  = "VARIABLE_NAME";
            chkType.DataValueField = "VARIABLE_CODE";
            chkType.DataBind();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                chkType.Items[i].Selected = true;
                string color = ds.Tables[0].Rows[i]["COLOR_CODE"].ToString();
                chkType.Items[i].Attributes.Add("style", "background-color: " + color + ";");
                //chkType.Attributes.Add("style", "background-color: " + color + ";");
            }
        }
        catch { }
        {
        }
    }
Esempio n. 19
0
 protected void BindPendingPOGrid()
 {
     try
     {
         DataTable dt = BLL_POLOG_Register.POLOG_Get_Pending_Approval(UDFLib.ConvertToInteger(Session["UserID"].ToString()));
         if (dt.Rows.Count > 0)
         {
             divPendingPO.Visible   = true;
             gvPendingPO.DataSource = dt;
             gvPendingPO.DataBind();
         }
         else
         {
             divPendingPO.Visible   = false;
             gvPendingPO.DataSource = dt;
             gvPendingPO.DataBind();
         }
     }
     catch { }
     {
     }
 }
Esempio n. 20
0
    protected void BindSupplierInvoice(string Supplier_Code)
    {
        string  PayMode = null;
        DataSet ds      = BLL_POLOG_Register.POLOG_Get_Payment_Supplier_Invoice(Supplier_Code, PayMode, GetSessionUserID());

        if (ds.Tables[0].Rows.Count > 0)
        {
            gvPaymentDetails.DataSource = ds;
            gvPaymentDetails.DataBind();
            gvApprovedInvoice.DataSource = ds;
            gvApprovedInvoice.DataBind();
        }
        if (ds.Tables[1].Rows.Count > 0)
        {
            txtSupplierName.Text        = ds.Tables[1].Rows[0]["Supplier_Name"].ToString();
            txtPaymentTerms.Text        = ds.Tables[1].Rows[0]["Payment_Terms"].ToString();
            txtAddress.Text             = ds.Tables[1].Rows[0]["Address"].ToString();
            txtPayment.Text             = ds.Tables[1].Rows[0]["Payment_Instructions"].ToString();
            txtCity.Text                = ds.Tables[1].Rows[0]["City"].ToString();
            txtpaymentnotification.Text = ds.Tables[1].Rows[0]["Payment_Notifications"].ToString();
            txtEmail.Text               = ds.Tables[1].Rows[0]["Email"].ToString();
            txtPhone.Text               = ds.Tables[1].Rows[0]["Phone"].ToString();
            txtFax.Text = ds.Tables[1].Rows[0]["Fax"].ToString();
        }
        if (ds.Tables[2].Rows.Count > 0)
        {
            gvNewPayment.DataSource = ds.Tables[2];
            gvNewPayment.DataBind();
            if (ds.Tables[2].Rows[0]["PAYMENT_STATUS"].ToString() == "OPEN")
            {
                gvNewPayment.Rows[0].BackColor = System.Drawing.Color.Yellow;
                txtPaymodeID.Text    = ds.Tables[2].Rows[0]["PAYMENT_ID"].ToString();
                txtPayment_Year.Text = ds.Tables[2].Rows[0]["PAYMENT_YEAR"].ToString();
                GetPaymentDetails(txtPaymodeID.Text, txtPayment_Year.Text);
                btnUpdate.Enabled = true;
                btnlink.Enabled   = true;
            }
        }
    }
Esempio n. 21
0
 protected void btnVerified_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()));
         //string msgDraft = String.Format("parent.ReloadParent_ByButtonID();");
         //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgDraft", msgDraft, true);
         if (retval != "0")
         {
             txtInvoiceID.Text = Convert.ToString(retval);
             BindInvoice();
             int    RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(lblInvoiceID.Text), "Verified Invoice", "VerifiedInvoice", UDFLib.ConvertToInteger(GetSessionUserID()));
             string message     = "alert('Invoice Verified.')";
             ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "alert", message, true);
         }
         else
         {
             string message = "alert('Invoice Cant be verified before uploading attachment.')";
             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);
     }
 }
Esempio n. 22
0
 public void imgbtnDelete_Click(object s, EventArgs e)
 {
     try
     {
         string[] arg = (((ImageButton)s).CommandArgument.Split(new char[] { ',' }));
         int      res = BLL_POLOG_Register.POLOG_Delete_Attachments(arg[0].ToString(), arg[1].ToString(), Convert.ToInt16(GetSessionUserID()));
         //string SavePath = Server.MapPath("\\" + System.Configuration.ConfigurationManager.AppSettings["APP_NAME"].ToString() + "\\Uploads\\Files_Uploaded");
         //string SavePath = ("../Uploads/Files_Uploaded");
         //string File_ID = arg[0];
         //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 + "\\" + arg[2];
         //if (File.Exists(filePath))
         //{
         //    File.Delete(filePath);
         //}
     }
     catch
     { }
 }
Esempio n. 23
0
    protected void AjaxFileUpload1_OnUploadComplete(object sender, AjaxFileUploadEventArgs file)
    {
        try
        {
            BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase();

            Byte[] fileBytes   = file.GetContents();
            string SavePath    = Server.MapPath("\\" + System.Configuration.ConfigurationManager.AppSettings["APP_NAME"].ToString() + "\\Uploads\\Files_Uploaded");
            Guid   GUID        = Guid.NewGuid();
            string Flag_Attach = GUID.ToString() + Path.GetExtension(file.FileName);


            string FileID = BLL_POLOG_Register.POLOG_Insert_AttachedFile(UDFLib.ConvertStringToNull(Request.QueryString["ID"].ToString()), Path.GetExtension(file.FileName),
                                                                         UDFLib.Remove_Special_Characters(Path.GetFileName(file.FileName)), Flag_Attach, Request.QueryString["DocType"].ToString(), Convert.ToInt16(GetSessionUserID()));

            FileID = FileID.PadLeft(8, '0');
            string F1 = Mid(FileID, 0, 2);
            string F2 = Mid(FileID, 2, 2);
            string F3 = Mid(FileID, 4, 2);
            if (!Directory.Exists(SavePath + F1 + "\\" + F2 + "\\" + F3))
            {
                Directory.CreateDirectory(SavePath + F1 + "\\" + F2 + "\\" + F3);
            }



            string FullFilename = Path.Combine(SavePath + "\\" + F1 + "\\" + F2 + "\\" + F3, FileID.ToString() + Path.GetExtension(file.FileName));

            //string FullFilename = Path.Combine(sPath, GUID.ToString() + Path.GetExtension(file.FileName));
            FileStream fileStream = new FileStream(FullFilename, FileMode.Create, FileAccess.ReadWrite);
            fileStream.Write(fileBytes, 0, fileBytes.Length);
            fileStream.Close();

            ScriptManager.RegisterStartupScript(this, typeof(Page), "refresh", "fn_OnClose(a,b)", true);
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 24
0
    protected void BindType()
    {
        DataSet ds = BLL_POLOG_Register.POLOG_Get_Type(UDFLib.ConvertToInteger(GetSessionUserID()), "Payment_Mode");

        ddlPayMode.DataSource     = ds.Tables[11];
        ddlPayMode.DataTextField  = "VARIABLE_NAME";
        ddlPayMode.DataValueField = "VARIABLE_CODE";
        ddlPayMode.DataBind();
        ddlPayMode.Items.Insert(0, new ListItem("-Select-", "0"));

        rdbPaymode.DataSource     = ds.Tables[12];
        rdbPaymode.DataTextField  = "VARIABLE_NAME";
        rdbPaymode.DataValueField = "VARIABLE_CODE";
        rdbPaymode.DataBind();
        rdbPaymode.Items.Insert(0, new ListItem("CANCEL", "CANCEL"));

        ddlAccount.DataSource     = ds.Tables[13];
        ddlAccount.DataTextField  = "Account_Name";
        ddlAccount.DataValueField = "Account_ID";
        ddlAccount.DataBind();
        ddlAccount.Items.Insert(0, new ListItem("-Select-", "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());
        }

        ChkStatus();

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


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


        string[] HeaderCaptions  = { "PO Status", "PO Date", "PO Code", "ship Ref Code", "Acct", "Amount", "Cur", "PO USD Value", "Invoice USD Amount", "Paid USD Amount", "Outstanding PO Amount", "Supplier Name" };
        string[] DataColumnsName = { "Line_Status", "Line_Date", "Office_Ref_Code", "ship_Ref_Code", "Account_Classification", "Line_Amount", "Line_Currency", "PO_USD_Value", "Invoice_USD_Amount", "Paid_USD_Amount", "OutStanding_USD_Amount", "Supplier_Name" };

        GridViewExportUtil.ShowExcel(ds.Tables[0], HeaderCaptions, DataColumnsName, "Purchasing_Report", "Purchasing Report", "");
    }
Esempio n. 26
0
    public void BindReqsnAttchment()
    {
        //Parent_invoice_id.Value = "0000";
        string    DocType      = "Invoice";
        DataTable dtAttachment = BLL_POLOG_Register.POLOG_Get_Attachments(UDFLib.ConvertStringToNull(hiddenTransfer.Value), DocType);

        if (dtAttachment.Rows.Count > 0)
        {
            string FilePath = dtAttachment.Rows[0]["File_Path"].ToString();
            gvReqsnAttachment.DataSource = dtAttachment;
            gvReqsnAttachment.DataBind();
            gvReqsnAttachment.Visible = true;
            divAttachment.Visible     = true;
        }
        else
        {
            gvReqsnAttachment.DataSource = dtAttachment;
            gvReqsnAttachment.DataBind();

            divAttachment.Visible = false;
        }
    }
    protected void btnApprove_Click(object sender, CommandEventArgs e)
    {
        string msg2 = null;

        string[] arg        = e.CommandArgument.ToString().Split(',');
        string   Invoice_ID = UDFLib.ConvertStringToNull(arg[0]);
        string   Status     = "Approved";
        string   InvStatus  = "Approved";
        int      Retval     = Update_Invoice(Invoice_ID, Status, InvStatus);

        if (Retval == 1)
        {
            int RetAuditVal = BLL_POLOG_Register.POLOG_Insert_Transactionlog(UDFLib.ConvertStringToNull(Invoice_ID), "Approved Invoice", "ApprovedInvoice", UDFLib.ConvertToInteger(GetSessionUserID()));
            msg2 = String.Format("alert('Invoice Approved.')");

            BindGrid();
        }
        else
        {
            msg2 = String.Format("alert('Disputed Invoice Cant be approved.')");
        }
        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg2, true);
    }
Esempio n. 28
0
 protected void BindPOType()
 {
     try
     {
         DataSet ds = BLL_POLOG_Register.POLOG_Get_Type(UDFLib.ConvertToInteger(Session["UserID"].ToString()), "PO_TYPE");
         if (ds.Tables[1].Rows.Count > 0)
         {
             ddlPOType.DataSource     = ds.Tables[1];
             ddlPOType.DataTextField  = "VARIABLE_NAME";
             ddlPOType.DataValueField = "VARIABLE_CODE";
             ddlPOType.DataBind();
             ddlPOType.Items.Insert(0, new ListItem("-Select-", "0"));
         }
         else
         {
             ddlPOType.Items.Insert(0, new ListItem("-Select-", "0"));
         }
         //
     }
     catch { }
     {
     }
 }
Esempio n. 29
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

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

        string str;

        if (chkClosePO.Checked == true)
        {
            str = "yes";
        }
        else
        {
            str = "No";
        }
        DataTable dt = BLL_POLOG_Register.POLOG_Get_PO_Search(txtfilter.Text.Trim() != "" ? txtfilter.Text.Trim() : null, UDFLib.ConvertStringToNull(ddlSupplier.SelectedValue),
                                                              UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue),
                                                              UDFLib.ConvertStringToNull(ddlAccClassification.SelectedValue), UDFLib.ConvertStringToNull(ddlAccountType.SelectedValue),
                                                              UDFLib.ConvertStringToNull(InvoiceStatus), dtType, str,
                                                              sortbycoloumn, sortdirection
                                                              , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);



        string[] HeaderCaptions  = { "Created Date", "Office Ref. Code", "Supplier Name", "Line Currency", "Total Amount", "Invoice Amount", "Invoice Count" };
        string[] DataColumnsName = { "Created_Date", "Office_Ref_Code", "Supplier Name", "Line Currency", "TotalAmount", "Invoice_Amount", "Invoice_Count" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "PO LOG", "PO LOG", "");
    }
    protected void BindDuplicateInvoice(string InvoiceID)
    {
        try
        {
            DataTable dt = BLL_POLOG_Register.POLOG_Get_DuplicateInvoice(InvoiceID);

            if (dt.Rows.Count > 0)
            {
                lblDuplicateInvoice.Text       = "Duplicated invoice Reference Found";
                divDuplicateInvoice.Visible    = true;
                gvDuplieCateinvoice.DataSource = dt;
                gvDuplieCateinvoice.DataBind();
            }
            else
            {
                divDuplicateInvoice.Visible    = false;
                gvDuplieCateinvoice.DataSource = dt;
                gvDuplieCateinvoice.DataBind();
            }
        }
        catch { }
        {
        }
    }