예제 #1
0
    private void DisplayReferences()
    {
        CompanyTransaction companyDetails = new CompanyTransaction();
        DataTable          vendorRef;
        string             refTypeName, refTypeExtra;

        vendorRef    = companyDetails.QueryVendorReferences(connstring, ViewState[Constant.SESSION_USERID].ToString().Trim(), Constant.REF_MAIN_CUSTOMERS);
        refTypeName  = companyDetails.GetReferenceTypeName(connstring, Constant.REF_MAIN_CUSTOMERS.ToString());
        refTypeExtra = companyDetails.GetReferenceTypeExtra(connstring, Constant.REF_MAIN_CUSTOMERS.ToString());
        FillReferenceTable(vendorRef, "AveMonthlySales", refTypeName, refTypeExtra);

        vendorRef    = companyDetails.QueryVendorReferences(connstring, ViewState[Constant.SESSION_USERID].ToString().Trim(), Constant.REF_BANKS);
        refTypeName  = companyDetails.GetReferenceTypeName(connstring, Constant.REF_BANKS.ToString());
        refTypeExtra = companyDetails.GetReferenceTypeExtra(connstring, Constant.REF_BANKS.ToString());
        FillReferenceTable(vendorRef, "CreditLine", refTypeName, refTypeExtra);

        vendorRef    = companyDetails.QueryVendorReferences(connstring, ViewState[Constant.SESSION_USERID].ToString().Trim(), Constant.REF_AFFILIATE);
        refTypeName  = companyDetails.GetReferenceTypeName(connstring, Constant.REF_AFFILIATE.ToString());
        refTypeExtra = companyDetails.GetReferenceTypeExtra(connstring, Constant.REF_AFFILIATE.ToString());
        FillReferenceTable(vendorRef, "KindOfBusiness", refTypeName, refTypeExtra);

        vendorRef    = companyDetails.QueryVendorReferences(connstring, ViewState[Constant.SESSION_USERID].ToString().Trim(), Constant.REF_EXTERN_AUDITOR);
        refTypeName  = companyDetails.GetReferenceTypeName(connstring, Constant.REF_EXTERN_AUDITOR.ToString());
        refTypeExtra = companyDetails.GetReferenceTypeExtra(connstring, Constant.REF_EXTERN_AUDITOR.ToString());
        FillReferenceTable(vendorRef, "LegalCounsel", refTypeName, refTypeExtra);
    }
예제 #2
0
    private void DisplayRelatives()
    {
        CompanyTransaction companyDetails = new CompanyTransaction();
        DataTable          equipments     = companyDetails.QueryVendorRelatives(connstring, ViewState[Constant.SESSION_USERID].ToString().Trim());
        HtmlTableRow       htmlRow        = new HtmlTableRow();

        HtmlTableCell[] cell = new HtmlTableCell[3];

        if (equipments.Rows.Count > 0)
        {
            itemDetailsV.Visible = true;
            int i = 1;
            foreach (DataRow row in equipments.Rows)
            {
                htmlRow = new HtmlTableRow();
                cell[0] = new HtmlTableCell();
                cell[0].Attributes.Add("class", ((i % 2 == 0) ? "evenCells" : "value"));
                cell[0].Controls.Add(new LiteralControl(row["VendorRelative"].ToString()));
                htmlRow.Cells.Add(cell[0]);
                cell[1] = new HtmlTableCell();
                cell[1].Attributes.Add("class", ((i % 2 == 0) ? "evenCells" : "value"));
                cell[1].Controls.Add(new LiteralControl(row["Title"].ToString()));
                htmlRow.Cells.Add(cell[1]);
                cell[2] = new HtmlTableCell();
                cell[2].Attributes.Add("class", ((i % 2 == 0) ? "evenCells" : "value"));
                cell[2].Controls.Add(new LiteralControl(row["Relationship"].ToString()));
                htmlRow.Cells.Add(cell[2]);
                itemDetailsV.Rows.Add(htmlRow);
                i++;
            }
        }
    }
예제 #3
0
    private void displayDetails()
    {
        if (ViewState[Constant.SESSION_BIDREFNO] != null)
        {
            BidItem                 biditem  = BidItemTransaction.QueryBidItemInfo(connstring, ViewState[Constant.SESSION_BIDREFNO].ToString().Trim());
            CategoryTransaction     category = new CategoryTransaction();
            GroupDeptSecTransaction grp      = new GroupDeptSecTransaction();
            CompanyTransaction      cmp      = new CompanyTransaction();
            IncotermTransaction     inc      = new IncotermTransaction();
            OtherTransaction        dte      = new OtherTransaction();

            lblCompany.Text = cmp.GetCompanyName(connstring, biditem.CompanyId.ToString().Trim());

            lblRequestor.Text             = biditem.Requestor.ToString().Trim();
            lblPRNumber.Text              = biditem.PRRefNo.ToString().Trim();
            lblPRDate.Text                = biditem.PRDate.ToString().Trim();
            lblGroup.Text                 = grp.GetGroupDeptSecNameById(connstring, biditem.GroupDeptSec.ToString().Trim());
            lblBidReferenceNumber.Text    = biditem.BidRefNo.ToString().Trim();
            lblSubCategory.Text           = category.GetCategoryNameById(connstring, biditem.Category.ToString().Trim());
            lblBidSubmissionDeadline.Text = biditem.Deadline.ToString().Trim();
            lblBidItemDescription.Text    = biditem.ItemDescription;
            lblDeliverTo.Text             = biditem.DeliverTo;
            lblIncoterm.Text              = inc.GetIncotermName(connstring, biditem.Incoterm);

            hdBidEventType.Value = biditem.BidStatus.ToString().Trim();

            displayItemDetails();
            displaySuppliers();
        }
    }
예제 #4
0
    private void DisplayPresentServices()
    {
        CompanyTransaction companyDetails = new CompanyTransaction();
        DataTable          presentsvc     = companyDetails.QueryPresentServices(connstring, ViewState[Constant.SESSION_USERID].ToString().Trim());
        HtmlTableRow       htmlRow        = new HtmlTableRow();

        HtmlTableCell[] cell = new HtmlTableCell[3];

        if (presentsvc.Rows.Count > 0)
        {
            int i = 1;
            foreach (DataRow row in presentsvc.Rows)
            {
                htmlRow = new HtmlTableRow();
                cell[0] = new HtmlTableCell();
                cell[0].Attributes.Add("class", ((i % 2 == 0) ? "evenCells" : "value"));
                cell[0].Controls.Add(new LiteralControl(row["PlanName"].ToString()));
                htmlRow.Cells.Add(cell[0]);
                cell[1] = new HtmlTableCell();
                cell[1].Attributes.Add("class", ((i % 2 == 0) ? "evenCells" : "value"));
                cell[1].Controls.Add(new LiteralControl(row["AccountNo"].ToString()));
                htmlRow.Cells.Add(cell[1]);
                cell[2] = new HtmlTableCell();
                cell[2].Attributes.Add("class", ((i % 2 == 0) ? "evenCells" : "value"));
                cell[2].Controls.Add(new LiteralControl(row["CreditLimit"].ToString()));
                htmlRow.Cells.Add(cell[2]);
                itemDetails2.Rows.Add(htmlRow);
                i++;
            }
        }
    }
예제 #5
0
    private void DisplayEquipments()
    {
        CompanyTransaction companyDetails = new CompanyTransaction();
        DataTable          equipments     = companyDetails.QueryVendorEquipments(connstring, ViewState["VendorID"].ToString().Trim());
        HtmlTableRow       htmlRow        = new HtmlTableRow();

        HtmlTableCell[] cell = new HtmlTableCell[3];

        if (equipments.Rows.Count > 0)
        {
            int i = 1;
            foreach (DataRow row in equipments.Rows)
            {
                htmlRow = new HtmlTableRow();
                cell[0] = new HtmlTableCell();
                cell[0].Attributes.Add("class", ((i % 2 == 0) ? "evenCells" : "value"));
                cell[0].Controls.Add(new LiteralControl(row["EquipmentType"].ToString()));
                htmlRow.Cells.Add(cell[0]);
                cell[1] = new HtmlTableCell();
                cell[1].Attributes.Add("class", ((i % 2 == 0) ? "evenCells" : "value"));
                cell[1].Controls.Add(new LiteralControl(row["Units"].ToString()));
                htmlRow.Cells.Add(cell[1]);
                cell[2] = new HtmlTableCell();
                cell[2].Attributes.Add("class", ((i % 2 == 0) ? "evenCells" : "value"));
                cell[2].Controls.Add(new LiteralControl(row["Remarks"].ToString()));
                htmlRow.Cells.Add(cell[2]);
                itemDetails4.Rows.Add(htmlRow);
                i++;
            }
        }
    }
예제 #6
0
    private void DisplayDetails()
    {
        AuctionItem auctionItem = AuctionItemTransaction.QueryAuctionItemInfo(ViewState[Constant.SESSION_AUCTIONREFNO].ToString().Trim());

        CategoryTransaction     category = new CategoryTransaction();
        GroupDeptSecTransaction grp      = new GroupDeptSecTransaction();
        CompanyTransaction      cmp      = new CompanyTransaction();

        OtherTransaction dte = new OtherTransaction();

        lblCompany.Text = cmp.GetCompanyName(connstring, auctionItem.CompanyId.ToString().Trim());

        lblRequestor.Text = auctionItem.Requestor.ToString().Trim();
        lblPRNumber.Text  = auctionItem.PRRefNo.ToString().Trim();
        lblPRDate.Text    = auctionItem.PRDate.ToString().Trim();
        lblGroup.Text     = grp.GetGroupDeptSecNameById(connstring, auctionItem.GroupDeptSec.ToString().Trim());
        lblAuctionReferenceNumber.Text = auctionItem.AuctionRefNo.ToString().Trim();
        lblSubCategory.Text            = category.GetCategoryNameById(connstring, auctionItem.Category.ToString().Trim());
        // lblDeadline.Text = auctionItem.Deadline.ToString().Trim();
        lblDeliveryDate.Text = auctionItem.DeliveryDate.ToString().Trim();
        lblItemDesc.Text     = auctionItem.ItemDescription.ToString().Trim();

        lblAuctionType.Text      = AuctionItemTransaction.GetAuctionTypeById(auctionItem.AuctionType.ToString().Trim());
        lblAuctionDeadline.Text  = auctionItem.AuctionDeadline.ToString().Trim();
        lblAuctionDate.Text      = auctionItem.AuctionStartDate.ToString().Trim();
        lblAuctionStartTime.Text = auctionItem.AuctionStartTime.ToString().Trim();
        lblAuctionEndTime.Text   = auctionItem.AuctionEndTime.ToString().Trim();
        lblBidCurrency.Text      = AuctionItemTransaction.getBidCurrency(auctionItem.BidCurrency.ToString().Trim());
    }
예제 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();
        connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());
        if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER)
        {
            Response.Redirect("../unauthorizedaccess.aspx");
        }

        if (!(IsPostBack))
        {
            Session[Constant.SESSION_COMMENT_TYPE] = "1";
            if (Request.QueryString["AuctionRefNo"] != null)
            {
                Session["AuctionRefNo"] = Request.QueryString["AuctionRefNo"].ToString().Trim();
            }

            if (Session["AuctionRefNo"] != null)
            {
                hdnAuctionRefNo.Value = Session["AuctionRefNo"].ToString().Trim();
            }

            if (hdnAuctionRefNo.Value.Trim() != "")
            {
                AuctionTransaction      au  = new AuctionTransaction();
                AuctionItem             ai  = au.GetAuctionByAuctionRefNo(connstring, hdnAuctionRefNo.Value.Trim());
                CompanyTransaction      cmp = new CompanyTransaction();
                GroupDeptSecTransaction grp = new GroupDeptSecTransaction();
                CategoryTransaction     cat = new CategoryTransaction();
                OtherTransaction        oth = new OtherTransaction();
                lblCompany.Text         = cmp.GetCompanyName(connstring, ai.CompanyId.ToString().Trim());
                lblRequestor.Text       = ai.Requestor.ToString().Trim();
                lblPRNumber.Text        = ai.PRRefNo.ToString().Trim();
                lblPRDate.Text          = ai.PRDate.ToString().Trim();
                lblGroup.Text           = grp.GetGroupDeptSecNameById(connstring, ai.GroupDeptSec.ToString().Trim());
                lblSubCategory.Text     = cat.GetCategoryNameById(connstring, ai.Category.ToString().Trim());
                lblDeadline.Text        = ai.AuctionDeadline.ToString().Trim();
                lblDeliveryDate.Text    = ai.DeliveryDate.ToString().Trim();
                lblItemDescription.Text = ai.ItemDescription.ToString().Trim();
                lblReferenceNumber.Text = hdnAuctionRefNo.Value.Trim();

                lblAuctionType.Text = au.GetAuctionTypeNameById(connstring, ai.AuctionType.ToString().Trim());
                lblAuctionConfirmationDeadline.Text = ai.AuctionDeadline.ToString().Trim();
                lblAuctionEventDate.Text            = ai.AuctionStartDate.ToString().Trim();
                lblAuctionStartTime.Text            = ai.AuctionStartTimeHour.ToString().Trim() + ":" +
                                                      ai.AuctionStartTimeMin.ToString().Trim() + ":" +
                                                      ai.AuctionStartTimeSec.ToString().Trim() + " " +
                                                      ai.AuctionStartTimeAMPM.ToString().Trim();
                lblAuctionEndTime.Text = ai.AuctionEndTimeHour.ToString().Trim() + ":" +
                                         ai.AuctionEndTimeMin.ToString().Trim() + ":" +
                                         ai.AuctionEndTimeSec.ToString().Trim() + " " +
                                         ai.AuctionEndTimeAMPM.ToString().Trim();
                lblBidCurrency.Text = oth.GetBidCurrency(ai.BidCurrency.ToString().Trim());

                ShowSuppliers();
                ShowFiles(ai.FileAttachments.ToString().Trim());
                ShowAuctionItems();
            }
        }
    }
예제 #8
0
    private void DisplayCompanyInfo()
    {
        CompanyTransaction companyDetails = new CompanyTransaction();
        CompanyDetails     companyInfo    = companyDetails.QueryCompanyDetails(ViewState["VendorID"].ToString().Trim());

        lblCompanyName.Text       = companyInfo.CompanyName;
        lblHeadOfficeAddress.Text = companyInfo.Address + " " + companyInfo.Address1;
        lblTelephone.Text         = companyInfo.HeadTelephone;
        lblFax.Text               = companyInfo.HeadFax;
        lblExtension.Text         = companyInfo.HeadExtension;
        lblBranchAddress.Text     = companyInfo.Address2 + " " + companyInfo.Address3;
        lblBranchPhone.Text       = companyInfo.BranchTelephone;
        lblBranchFax.Text         = companyInfo.BranchFax;
        lblBranchExtension.Text   = companyInfo.BranchExtension;
        lblVatRegNo.Text          = companyInfo.VatRegNo;
        lblTin.Text               = companyInfo.TIN;
        lblPOBox.Text             = companyInfo.POBox;
        lblPostalCode.Text        = companyInfo.PostalCode;
        lblEmail.Text             = companyInfo.CompanyEmail;
        lblTermsofPayment.Text    = companyInfo.TermsofPayment;
        lblSpecialTerms.Text      = companyInfo.SpecialTerms + " %PPD";
        lblMinOrderValue.Text     = companyInfo.MinOrderValue;
        lblSalesPerson.Text       = companyInfo.SalesPerson;
        lblSalesPersonPhone.Text  = companyInfo.SalesPersonPhone;
        lblOrgType.Text           = companyDetails.GetOrganizationType(companyInfo.OrganizationType.ToString().Trim());
        lblOwnershipFilipino.Text = companyInfo.OwnershipFilipino + "%";
        lblOwnershipOther.Text    = companyInfo.OwnershipOther + "%";
        lblClassification.Text    = companyDetails.GetClassificationName(companyInfo.Classification.ToString().Trim());
        lblSoleSupplier.Text      = companyInfo.SoleSupplier + ((companyInfo.SoleSupplier1 != null) ? ", " + companyInfo.SoleSupplier1 : "");
        lblSpecialization.Text    = companyInfo.Specialization;

        lblKeyPersonnel.Text = companyInfo.KeyPersonnel;
        lblKpPosition.Text   = companyInfo.KpPosition;
    }
예제 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();
        connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());
        if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER)
        {
            Response.Redirect("../unauthorizedaccess.aspx");
        }

        if (Request.QueryString["brn"] != null)
        {
            Session[Constant.SESSION_BIDREFNO] = Request.QueryString["brn"].ToString();
        }

        if (!(Page.IsPostBack))
        {
            if (Request.QueryString[Constant.SESSION_BIDREFNO] != null)
            {
                Session[Constant.SESSION_BIDREFNO] = Request.QueryString[Constant.SESSION_BIDREFNO].ToString().Trim();
            }

            if (Session["ORDERBY"] == null)
            {
                Session["ORDERBY"] = "DESC";
            }

            BidItem                 bid      = BidItemTransaction.QueryBidItemInfo(connstring, Session[Constant.SESSION_BIDREFNO].ToString());
            BuyerTransaction        buyer    = new BuyerTransaction();
            CategoryTransaction     category = new CategoryTransaction();
            GroupDeptSecTransaction grp      = new GroupDeptSecTransaction();
            CompanyTransaction      cmp      = new CompanyTransaction();
            VendorTransaction       vnd      = new VendorTransaction();
            IncotermTransaction     inc      = new IncotermTransaction();
            OtherTransaction        obj      = new OtherTransaction();

            lblBidReferenceNumber.Text = bid.BidRefNo.ToString().Trim();

            lblCompany.Text               = cmp.GetCompanyName(connstring, bid.CompanyId.ToString().Trim());
            lblRequestor.Text             = bid.Requestor.ToString().Trim();
            lblPRNumber.Text              = bid.PRRefNo.ToString().Trim();
            lblPRDate.Text                = bid.PRDate.ToString().Trim();
            lblGroup.Text                 = grp.GetGroupDeptSecNameById(connstring, bid.GroupDeptSec.ToString().Trim());
            lblBidRefNo.Text              = bid.BidRefNo.ToString().Trim();
            lblSubCategory.Text           = category.GetCategoryNameById(connstring, bid.Category.ToString().Trim());
            lblBidSubmissionDeadline.Text = bid.Deadline.ToString().Trim();
            lblBidItemDesc.Text           = bid.ItemDescription.ToString().Trim();
            lblDeliverTo.Text             = bid.DeliverTo.ToString().Trim();
            lblIncoterm.Text              = inc.GetIncotermName(connstring, bid.Incoterm.ToString().Trim());

            DisplayDetails();
            Bind();
        }
    }
예제 #10
0
    private void FillBidInfo()
    {// Get bid general details
        CategoryTransaction cat = new CategoryTransaction();
        IncotermTransaction inc = new IncotermTransaction();
        CompanyTransaction  cmp = new CompanyTransaction();
        BidItem             bid = BidItemTransaction.GetBidDetailsByRefNo(hdnBidRefNo.Value.Trim());

        lblCompany.Text               = cmp.GetCompanyName(connstring, bid.CompanyId.ToString().Trim());
        lblCategory.Text              = cat.GetCategoryNameById(bid.Category.ToString().Trim());
        lblBidReferenceNumber.Text    = bid.BidRefNo.ToString();
        lblBidSubmissionDeadline.Text = bid.Deadline;
        lblBidItemDescription.Text    = bid.ItemDescription;
        lblDeliverTo.Text             = bid.DeliverTo;
        lblPreferredIncoterm.Text     = inc.GetIncotermName(connstring, bid.Incoterm);
    }
예제 #11
0
        public ActionResult Edit(Company company, HttpPostedFileBase logo)
        {
            ViewBag.Message = "Successfully Updated";
            // need to handle the file size
            if (logo != null && logo.ContentLength > 0 && logo.ContentType.Contains("image"))
            {
                using (Stream inputStream = logo.InputStream)
                {
                    MemoryStream memoryStream = inputStream as MemoryStream;
                    if (memoryStream == null)
                    {
                        memoryStream = new MemoryStream();
                        inputStream.CopyTo(memoryStream);
                    }
                    company.LogoUrl    = logo.FileName;
                    company.LogoBinary = memoryStream.ToArray();
                }
            }
            CompanyTransaction transaction = _companyService.Update(company);

            if (transaction == CompanyTransaction.Success)
            {
                return(Redirect(Url.Action("Details", "Company", new { id = company.Id })));
            }
            switch (transaction)
            {
            case CompanyTransaction.DuplicateName:
                ModelState.AddModelError(nameof(company.Name), "is duplicate");
                break;

            case CompanyTransaction.Error:
                break;

            case CompanyTransaction.WrongImageType:
                ModelState.AddModelError(nameof(company.LogoBinary), "Wrong image");
                break;
            }
            return(View("_Edit", company));
        }
예제 #12
0
    private void DisplayCompanyInfo()
    {
        CompanyTransaction companyDetails = new CompanyTransaction();
        CompanyDetails     companyInfo    = companyDetails.QueryCompanyDetails(connstring, ViewState["VendorID"].ToString().Trim());

        lblCompanyName.Text = companyInfo.CompanyName;

        if (companyInfo.IsBlackListed == 1)
        {
            lblIsBlacklisted.Visible = true;
            btBlackList.Text         = "Remove Blacklist";
            hdBlacklisted.Value      = "1";
        }
        else
        {
            lblIsBlacklisted.Visible = false;
            btBlackList.Text         = "Blacklist Supplier";
            hdBlacklisted.Value      = "0";
        }

        lblHeadOfficeAddress.Text = companyInfo.Address + " " + companyInfo.Address1;
        lblTelephone.Text         = companyInfo.HeadTelephone;
        lblFax.Text               = companyInfo.HeadFax;
        lblExtension.Text         = companyInfo.HeadExtension;
        lblBranchAddress.Text     = companyInfo.Address2 + " " + companyInfo.Address3;
        lblBranchPhone.Text       = companyInfo.BranchTelephone;
        lblBranchFax.Text         = companyInfo.BranchFax;
        lblBranchExtension.Text   = companyInfo.BranchExtension;
        lblVatRegNo.Text          = companyInfo.VatRegNo;
        lblTin.Text               = companyInfo.TIN;
        lblPOBox.Text             = companyInfo.POBox;
        lblPostalCode.Text        = companyInfo.PostalCode;
        lblEmail.Text             = companyInfo.CompanyEmail;
        lblTermsofPayment.Text    = companyInfo.TermsofPayment;
        lblSpecialTerms.Text      = companyInfo.SpecialTerms + " %PPD";
        lblMinOrderValue.Text     = companyInfo.MinOrderValue;
        lblSalesPerson.Text       = companyInfo.SalesPerson;
        lblSalesPersonPhone.Text  = companyInfo.SalesPersonPhone;
        lblOrgType.Text           = companyDetails.GetOrganizationType(connstring, companyInfo.OrganizationType.ToString().Trim());
        lblOwnershipFilipino.Text = companyInfo.OwnershipFilipino + "%";
        lblOwnershipOther.Text    = companyInfo.OwnershipOther + "%";
        lblClassification.Text    = companyDetails.GetClassificationName(connstring, companyInfo.Classification.ToString().Trim());
        lblSoleSupplier.Text      = companyInfo.SoleSupplier + ((companyInfo.SoleSupplier1 != null) ? ", " + companyInfo.SoleSupplier1 : "");
        lblSpecialization.Text    = companyInfo.Specialization;

        lblKeyPersonnel.Text = companyInfo.KeyPersonnel;
        lblKpPosition.Text   = companyInfo.KpPosition;

        switch (companyInfo.ISOStandard.Trim())
        {
        case "01":
            lblISOStandard.Text = "ISO 9002";
            break;

        case "10":
            lblISOStandard.Text = "ISO 9001";
            break;

        case "11":
            lblISOStandard.Text = "ISO 9001<br />ISO 9002";
            break;
        }
    }
예제 #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();
            connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());
            if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER)
            {
                Response.Redirect("../unauthorizedaccess.aspx");
            }


            if (!(Page.IsPostBack))
            {
                if (Session["BidRefNo"] != null)
                {
                    hdnBidRefNo.Value = Session["BidRefNo"].ToString().Trim();
                    BidItem                 bid      = BidItemTransaction.QueryBidItemInfo(connstring, hdnBidRefNo.Value.Trim());
                    BuyerTransaction        buyer    = new BuyerTransaction();
                    CategoryTransaction     category = new CategoryTransaction();
                    GroupDeptSecTransaction grp      = new GroupDeptSecTransaction();
                    CompanyTransaction      cmp      = new CompanyTransaction();
                    SupplierTransaction     vnd      = new SupplierTransaction();
                    IncotermTransaction     inc      = new IncotermTransaction();
                    OtherTransaction        dte      = new OtherTransaction();

                    lblCompany.Text               = cmp.GetCompanyName(connstring, bid.CompanyId.ToString().Trim());
                    lblRequestor.Text             = bid.Requestor.ToString().Trim();
                    lblPRNumber.Text              = bid.PRRefNo.ToString().Trim();
                    lblPRDate.Text                = bid.PRDate.ToString().Trim();
                    lblGroup.Text                 = grp.GetGroupDeptSecNameById(connstring, bid.GroupDeptSec.ToString().Trim());
                    lblBidReferenceNo.Text        = bid.BidRefNo.ToString().Trim();
                    lblSubCategory.Text           = category.GetCategoryNameById(connstring, bid.Category.ToString().Trim());
                    lblBidSubmissionDeadline.Text = bid.Deadline.ToString().Trim();
                    lblBidItemDescription.Text    = bid.ItemDescription.ToString().Trim();
                    lblDeliverTo.Text             = bid.DeliverTo.ToString().Trim();
                    lblIncoterm.Text              = inc.GetIncotermName(connstring, bid.Incoterm.ToString().Trim());
                    lblBidRefNo2.Text             = bid.BidRefNo.ToString().Trim();

                    FillBidItemDetails();
                    //no checking because when bids are submitted they have suppliers
                    gvSuppliers.DataSource = BidItemTransaction.GetSuppliers(connstring, hdnBidRefNo.Value.Trim());
                    gvSuppliers.DataBind();

                    //DataTable dtFileAttachment = new DataTable();
                    //DataColumn dcol1 = new DataColumn("FILES", typeof(System.String));
                    //dtFileAttachment.Columns.Add(dcol1);

                    //string Files = bid.FileAttachments;
                    //string[] Files1 = Files.Split(Convert.ToChar("|"));

                    //for (int i = 0; i < Files1.Length; i++)
                    //{
                    //    //Create a new row
                    //    DataRow drow = dtFileAttachment.NewRow();
                    //    drow["FILES"] = Files1[i];
                    //    dtFileAttachment.Rows.Add(drow);
                    //}

                    //gvFileAttachments.DataSource = dtFileAttachment;
                    //gvFileAttachments.DataBind();
                }
                else
                {
                    Response.Redirect("index.aspx");
                }
            }
        }
예제 #14
0
    protected void gridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        ViewState[Constant.SESSION_USERID] = Int32.Parse(Session[Constant.SESSION_USERID].ToString().Trim());
        int    userID   = Int32.Parse(ViewState[Constant.SESSION_USERID].ToString().Trim());
        string usertype = Session[Constant.SESSION_USERTYPE].ToString().Trim();

        if (Request.QueryString["usertype"] != null)
        {
            usertype = Request.QueryString["usertype"].ToString().Trim();
        }
        string searchstring = "";

        if (Request.QueryString["searchstring"] != null)
        {
            searchstring = Request.QueryString["searchstring"].ToString().Trim();
        }
        string searchType = "1";

        if (Request.QueryString["searchType"] != null)
        {
            searchType = Request.QueryString["searchType"].ToString().Trim();
        }

        if ((Int32.Parse(searchType) >= 1) && (Int32.Parse(searchType) <= 6))
        {
            if ((Int32.Parse(searchType) >= 1) && (Int32.Parse(searchType) <= 3))
            {
                gvSearchResultForItems.Columns[0].HeaderText = "Bid Reference No.";
                gvSearchResultForItems.Columns[1].HeaderText = "Bid Items";
            }
            else
            {
                gvSearchResultForItems.Columns[0].HeaderText = "Auction Reference No.";
                gvSearchResultForItems.Columns[1].HeaderText = "Auction Items";
            }

            gvSearchResultForItems.Visible = true;

            DataTable dtItems = BidItemTransaction.QuerySearchedItemByItemDesc(connstring, Int32.Parse(searchType), searchstring, Int32.Parse(usertype), userID);
            DataView  dvItems = new DataView(dtItems);

            gvSearchResultForItems.DataSource = dvItems;
            gvSearchResultForItems.PageIndex  = e.NewPageIndex;
            gvSearchResultForItems.DataBind();
        }
        else if (Int32.Parse(searchType) == 7)
        {
            ProductsTransaction products = new ProductsTransaction();

            DataTable dtProducts = products.QueryProductsViaName(connstring, searchstring);

            gvProducts.Visible = true;

            gvProducts.DataSource = dtProducts;
            gvProducts.PageIndex  = e.NewPageIndex;
            gvProducts.DataBind();
        }
        else if (Int32.Parse(searchType) == 8)
        {
            CompanyTransaction vendor = new CompanyTransaction();

            DataTable dtVendor = vendor.QueryVendorSearch(connstring, searchstring);
            DataView  dvVendor = new DataView(dtVendor);

            gvSuppliers.Visible = true;

            gvSuppliers.DataSource = dvVendor;
            gvSuppliers.PageIndex  = e.NewPageIndex;
            gvSuppliers.DataBind();
        }
    }
예제 #15
0
        private void Display()
        {
            BidItem biditem = BidItemTransaction.QueryBidItemInfo(connstring, ViewState["BidRefNo"].ToString().Trim());
            //BidItemInfo biditem = obj.Query("91000");
            BuyerTransaction        buyer    = new BuyerTransaction();
            CategoryTransaction     category = new CategoryTransaction();
            GroupDeptSecTransaction grp      = new GroupDeptSecTransaction();
            CompanyTransaction      cmp      = new CompanyTransaction();
            IncotermTransaction     inc      = new IncotermTransaction();
            OtherTransaction        dte      = new OtherTransaction();

            lblCompany.Text               = cmp.GetCompanyName(connstring, biditem.CompanyId.ToString().Trim());
            lblRequestorName.Text         = biditem.Requestor.ToString().Trim();
            lblPRNumber.Text              = biditem.PRRefNo.ToString().Trim();
            lblPRDate.Text                = biditem.PRDate.ToString().Trim();
            lblGroupDeptSec.Text          = grp.GetGroupDeptSecNameById(connstring, biditem.GroupDeptSec.ToString().Trim());
            lblBidRefNum.Text             = biditem.BidRefNo.ToString().Trim();
            lblSubCategory.Text           = category.GetCategoryNameById(connstring, biditem.Category.ToString().Trim());
            lblBidSubmissionDeadline.Text = biditem.Deadline.ToString().Trim();
            lblBidItemDescription.Text    = biditem.ItemDescription;
            lblDeliverTo.Text             = biditem.DeliverTo;
            lblIncoterm.Text              = inc.GetIncotermName(connstring, biditem.Incoterm);

            DataTable  dtSuppliers = new DataTable();
            DataColumn dcol        = new DataColumn("SUPPLIER", typeof(System.String));

            dtSuppliers.Columns.Add(dcol);

            string suppliers = biditem.Suppliers;

            /*
             *          if (suppliers != "")
             *      btnSubmit.Enabled = true;
             */
            string[] suppliers1 = suppliers.Split(Convert.ToChar(","));

            for (int i = 0; i < suppliers1.Length; i++)
            {
                //Create a new row
                DataRow drow = dtSuppliers.NewRow();
                drow["SUPPLIER"] = suppliers1[i];
                dtSuppliers.Rows.Add(drow);
            }

            gvSuppliers.DataSource = dtSuppliers;
            gvSuppliers.DataBind();

            DataTable  dtFileAttachment = new DataTable();
            DataColumn dcol1            = new DataColumn("FILES", typeof(System.String));

            dtFileAttachment.Columns.Add(dcol1);

            string Files = biditem.FileAttachments;

            string[] Files1 = Files.Split(Convert.ToChar("|"));

            for (int i = 0; i < Files1.Length; i++)
            {
                //Create a new row
                DataRow drow = dtFileAttachment.NewRow();
                drow["FILES"] = Files1[i];
                dtFileAttachment.Rows.Add(drow);
            }

            gvFileAttachments.DataSource = dtFileAttachment;
            gvFileAttachments.DataBind();
        }
예제 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();
        connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());
        if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER)
        {
            Response.Redirect("../unauthorizedaccess.aspx");
        }

        if (!(Page.IsPostBack))
        {
            Session[Constant.SESSION_COMMENT_TYPE] = "0";
            if (Request.QueryString["BidRefNo"] != null)
            {
                Session["BidRefNo"] = Request.QueryString["BidRefNo"].ToString().Trim();
            }

            BidItem                 bid      = BidItemTransaction.QueryBidItemInfo(connstring, Request.QueryString["BidRefNo"].ToString().Trim());
            BuyerTransaction        buyer    = new BuyerTransaction();
            CategoryTransaction     category = new CategoryTransaction();
            GroupDeptSecTransaction grp      = new GroupDeptSecTransaction();
            CompanyTransaction      cmp      = new CompanyTransaction();
            VendorTransaction       vnd      = new VendorTransaction();
            IncotermTransaction     inc      = new IncotermTransaction();
            OtherTransaction        obj      = new OtherTransaction();

            lblCompany.Text               = cmp.GetCompanyName(connstring, bid.CompanyId.ToString().Trim());
            lblRequestor.Text             = bid.Requestor.ToString().Trim();
            lblPRNumber.Text              = bid.PRRefNo.ToString().Trim();
            lblPRDate.Text                = bid.PRDate.ToString().Trim();
            lblGroup.Text                 = grp.GetGroupDeptSecNameById(connstring, bid.GroupDeptSec.ToString().Trim());
            lblBidRefNo.Text              = bid.BidRefNo.ToString().Trim();
            lblSubCategory.Text           = category.GetCategoryNameById(connstring, bid.Category.ToString().Trim());
            lblBidSubmissionDeadline.Text = bid.Deadline.ToString().Trim();
            lblBidItemDesc.Text           = bid.ItemDescription.ToString().Trim();
            lblDeliverTo.Text             = bid.DeliverTo.ToString().Trim();
            lblIncoterm.Text              = inc.GetIncotermName(connstring, bid.Incoterm.ToString().Trim());

            DataTable dtSuppliers = BidItemTransaction.GetSuppliers(connstring, Session["BidRefNo"].ToString().Trim());
            gvSuppliers.DataSource = dtSuppliers;
            gvSuppliers.DataBind();

            DataTable  dtFileAttachment = new DataTable();
            DataColumn dcol1            = new DataColumn("FILES", typeof(System.String));
            dtFileAttachment.Columns.Add(dcol1);

            string   Files  = bid.FileAttachments;
            string[] Files1 = Files.Split(Convert.ToChar("|"));

            for (int i = 0; i < Files1.Length; i++)
            {
                //Create a new row
                DataRow drow = dtFileAttachment.NewRow();
                drow["FILES"] = Files1[i];
                dtFileAttachment.Rows.Add(drow);
            }

            gvFileAttachments.DataSource = dtFileAttachment;
            gvFileAttachments.DataBind();
        }
    }
예제 #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();
        connstring          = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());
        PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Search Result");
        if (!(IsPostBack))
        {
            if ((Session[Constant.SESSION_USERID] != null) && (Session[Constant.SESSION_USERTYPE] != null))
            {
                ViewState[Constant.SESSION_USERID] = Int32.Parse(Session[Constant.SESSION_USERID].ToString().Trim());
                int userID = Int32.Parse(ViewState[Constant.SESSION_USERID].ToString().Trim());

                int    usertype     = Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim());
                string searchstring = "";
                int    searchType   = 1;
                if (Request.QueryString["searchstring"] != null)
                {
                    searchstring = Request.QueryString["searchstring"].ToString().Trim();
                }
                if (Request.QueryString["searchType"] != null)
                {
                    searchType = Int32.Parse(Request.QueryString["searchType"].ToString().Trim());
                }

                if ((searchType >= 1) && (searchType <= 6))
                {
                    if ((searchType >= 1) && (searchType <= 3))
                    {
                        gvSearchResultForItems.Columns[0].HeaderText = "Bid Reference No.";
                        gvSearchResultForItems.Columns[1].HeaderText = "Bid Items";
                    }
                    else
                    {
                        gvSearchResultForItems.Columns[0].HeaderText = "Auction Reference No.";
                        gvSearchResultForItems.Columns[1].HeaderText = "Auction Items";
                    }

                    gvSearchResultForItems.Visible = true;

//                    BidItemTransaction items = new BidItemTransaction();

                    DataTable dtItems = BidItemTransaction.QuerySearchedItemByItemDesc(connstring, searchType, searchstring, usertype, userID);

                    if (dtItems.Rows.Count > 0)
                    {
                        DataView dvItems = new DataView(dtItems);

                        gvSearchResultForItems.DataSource = dvItems;
                        gvSearchResultForItems.DataBind();
                    }
                    else
                    {
                        lblIsEmpty.Visible = true;
                        lblIsEmpty.Text    = "No matches for '" + searchstring + "' found.";
                    }
                }
                else if (searchType == 7)
                {
                    ProductsTransaction products = new ProductsTransaction();

                    DataTable dtProducts = products.QueryProductsViaName(connstring, searchstring);
                    // DataView dvProducts = new DataView(dtProducts);

                    if (dtProducts.Rows.Count > 0)
                    {
                        gvProducts.Visible = true;

                        gvProducts.DataSource = dtProducts;
                        gvProducts.DataBind();
                    }
                    else
                    {
                        lblIsEmpty.Visible = true;
                        lblIsEmpty.Text    = "No matches for '" + searchstring + "' found.";
                    }
                }
                else if (searchType == 8)
                {
                    CompanyTransaction vendor = new CompanyTransaction();

                    DataTable dtVendor = vendor.QueryVendorSearch(connstring, searchstring);

                    if (dtVendor.Rows.Count > 0)
                    {
                        DataView dvVendor = new DataView(dtVendor);

                        gvSuppliers.Visible    = true;
                        gvSuppliers.DataSource = dvVendor;
                        gvSuppliers.DataBind();
                    }
                    else
                    {
                        lblIsEmpty.Visible = true;
                        lblIsEmpty.Text    = "No matches for '" + searchstring + "' found.";
                    }
                }
            }
        }
    }