コード例 #1
0
ファイル: Branch.aspx.cs プロジェクト: waheed258/rapti_dev
 private void BindCurrency()
 {
     try
     {
         DataSet ds = _objBoutility.GetCurrency();
         if (ds.Tables[0].Rows.Count > 0)
         {
             DDLCurrency.DataSource     = ds.Tables[0];
             DDLCurrency.DataTextField  = "code";
             DDLCurrency.DataValueField = "id";
             DDLCurrency.DataBind();
             DDLCurrency.Items.Insert(0, new ListItem("-- Please Select --", "0"));
         }
         else
         {
             DDLCurrency.DataSource = null;
             DDLCurrency.DataBind();
             DDLCurrency.Items.Insert(0, new ListItem("-- Please Select --", "0"));
         }
     }
     catch (Exception ex)
     {
         lblMsg.Text = _objBoutility.ShowMessage("danger", "error", ex.Message);
         ExceptionLogging.SendExcepToDB(ex);
     }
 }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserAccessValidation();

        if (!IsPostBack)
        {
            // first check for supplier's log-in
            if (!string.IsNullOrWhiteSpace(Convert.ToString(Session["SUPPCODE"])))
            {
                btnReworkToSupplier.Visible = false;
                btnRecallContract.Visible   = false;
            }

            BLL_Infra_Currency objCurr = new BLL_Infra_Currency();
            DDLCurrency.DataTextField  = "Currency_Code";
            DDLCurrency.DataValueField = "Currency_ID";
            DDLCurrency.DataSource     = objCurr.Get_CurrencyList();
            DDLCurrency.DataBind();
            ListItem lis = new ListItem("Select", "0");
            DDLCurrency.Items.Insert(0, lis);
            DDLCurrency.SelectedIndex = 0;

            BindContractInfo();
            BindDataItems();
            BindFieldsAfterSave();
        }
    }
コード例 #3
0
    protected void FillDDLs()
    {
        BLL_Infra_Currency objCurr = new BLL_Infra_Currency();

        DDLCurrency.DataTextField  = "Currency_Code";
        DDLCurrency.DataValueField = "Currency_ID";
        DDLCurrency.DataSource     = objCurr.Get_CurrencyList();
        DDLCurrency.DataBind();
        ListItem lis = new ListItem("Select", "0");

        DDLCurrency.Items.Insert(0, lis);
        DDLCurrency.SelectedIndex = 0;


        ddlHub.DataTextField  = "Description";
        ddlHub.DataValueField = "code";
        ddlHub.DataSource     = BLL_PURC_LOG.Get_Log_Hub_List();
        ddlHub.DataBind();
        ListItem lisHub = new ListItem("Select", "0");

        ddlHub.Items.Insert(0, lisHub);
        ddlHub.SelectedIndex = 0;

        BLL_PURC_Purchase objport = new BLL_PURC_Purchase();
        DataTable         dt      = objport.SelectSupplier();

        dt.DefaultView.RowFilter = " SUPPLIER_CATEGORY in ('A','S') and ASL_Status in ('Approve','Conditional') ";

        ddlAgentFord.DataTextField  = "SUPPLIER_NAME";
        ddlAgentFord.DataValueField = "SUPPLIER";
        ddlAgentFord.DataSource     = dt.DefaultView.ToTable();
        ddlAgentFord.DataBind();
        ddlAgentFord.Items.Insert(0, new ListItem("SELECT", "0"));
        ddlAgentFord.SelectedIndex = 0;

        //BLL_Infra_Port objBLLPort = new BLL_Infra_Port();
        //ctlPortList1.DataTextField = "Port_Name";
        //ctlPortList1.DataValueField = "Port_ID";
        //ctlPortList1.DataSource = objBLLPort.Get_PortList_Mini();
        //ctlPortList1.DataBind();

        //ctlPortList1.Items.Insert(0, new ListItem("SELECT", "0"));
        //ctlPortList1.SelectedIndex = 0;
    }
コード例 #4
0
    private void BindFieldsAfterSave()
    {
        DataTable dtInfo = BLL_PURC_CTP.Get_Ctp_Contract_Info(Convert.ToInt32(Request.QueryString["Quotation_ID"]));

        if (dtInfo.Rows.Count > 0)
        {
            ListItem liCurrency = DDLCurrency.Items.FindByText(dtInfo.Rows[0]["currency"].ToString());
            if (liCurrency != null)
            {
                DDLCurrency.ClearSelection();
                liCurrency.Selected = true;
            }
            txtBargeCharge.Text   = dtInfo.Rows[0]["Barge_Charge"].ToString();
            txtDiscount.Text      = dtInfo.Rows[0]["Discount"].ToString();
            txtFrieghtCharge.Text = dtInfo.Rows[0]["Freight_Charge"].ToString();
            txtOtherCharge.Text   = dtInfo.Rows[0]["Other_Charge"].ToString();
            txtPkgCharge.Text     = dtInfo.Rows[0]["Pkg_Hld_Charge"].ToString();
            txtTruckCharge.Text   = dtInfo.Rows[0]["Truck_Charge"].ToString();
            txtVat.Text           = dtInfo.Rows[0]["Vat"].ToString();


            lblApprovedItem_count.Text = "Item Count :-   Approved : " + dtInfo.Rows[0]["APPROVED_ITEM_COUNT"].ToString() + ",   Un Approved : " + dtInfo.Rows[0]["NOT_APPROVED_ITEM_COUNT"].ToString();

            if (dtInfo.Rows[0]["Quotation_Status"].ToString() == "FZ" || dtInfo.Rows[0]["Quotation_Status"].ToString() == "AP")
            {
                btnSaveAsDraft.Enabled          = false;
                btnSubmittoseach.Enabled        = false;
                hdf_Quotation_Save_Status.Value = "1";
                hlnkAddItem.Visible             = false;
            }
            else
            {
                btnSaveAsDraft.Enabled          = true;
                btnSubmittoseach.Enabled        = true;
                hdf_Quotation_Save_Status.Value = "0";
                hlnkAddItem.Visible             = true;
            }
        }
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AjaxFileUpload1.IsInFileUploadPostBack)
        {
        }
        else
        {
            UserAccessValidation();
            // lblLogisticId.Attributes.Add("style", "visibility:hidden");
            lblMessage.Visible              = false;
            ViewState["deleted"]            = "false";
            uc_SupplierList1.Web_Method_URL = "/" + System.Configuration.ConfigurationManager.AppSettings["APP_NAME"].ToString() + "/JibeWebService.asmx/asyncGet_Supplier_List";
            ctlPortList1.Web_Method_URL     = "/" + System.Configuration.ConfigurationManager.AppSettings["APP_NAME"].ToString() + "/JibeWebService.asmx/asyncGet_Port_List";

            btnLoadFiles.Attributes.Add("style", "visibility:hidden");
            if (!IsPostBack)
            {
                FillDDLs();

                imgbtnPurchaserRemark.Attributes.Add("onmouseover", "ASync_Get_Log_Remark(" + Request.QueryString["LOG_ID"] + ",event,this,0,3)");
                DataSet dsLog = BLL_PURC_LOG.Get_Log_Logistic_PO_Details(UDFLib.ConvertToInteger(Request.QueryString["LOG_ID"]));


                ViewState["Dept_Code"] = dsLog.Tables[1].Rows[0]["DEPARTMENT"].ToString();

                ViewState["deleted"] = Convert.ToString(dsLog.Tables[0].Rows[0]["active_status"]) == "0" ? true : false;

                // lblVesselName.Text = dsLog.Tables[0].Rows[0]["Vessel_Name"].ToString();
                lblLpoCode.Text = Request.QueryString["LOG_ID"];
                string wh       = "LOG_ID=" + Request.QueryString["LOG_ID"];
                string msgmodal = String.Format(" Get_Record_Information_Details('PURC_LIB_LOG_PO','" + wh + "');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Get_Record", msgmodal, true);
                Session["LOG_ID"] = Request.QueryString["LOG_ID"].ToString();

                // ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Get_records", "Get_records();", true);
                try
                {
                    DDLCurrency.ClearSelection();

                    if (DDLCurrency.Items.FindByText(dsLog.Tables[0].Rows[0]["Currency"].ToString()) != null)
                    {
                        DDLCurrency.Items.FindByText(dsLog.Tables[0].Rows[0]["Currency"].ToString()).Selected = true;
                        if (dsLog.Tables[3].Rows.Count > 0)
                        {
                            hdfExchrate.Value = dsLog.Tables[3].Rows[0]["ExchRate"].ToString();
                        }
                    }

                    ddlHub.ClearSelection();

                    if (ddlHub.Items.FindByValue(dsLog.Tables[0].Rows[0]["Hub"].ToString()) != null)
                    {
                        ddlHub.Items.FindByValue(dsLog.Tables[0].Rows[0]["Hub"].ToString()).Selected = true;
                    }

                    ddlAgentFord.ClearSelection();

                    if (ddlAgentFord.Items.FindByValue(dsLog.Tables[0].Rows[0]["Supplier_Code"].ToString()) != null)
                    {
                        ddlAgentFord.Items.FindByValue(dsLog.Tables[0].Rows[0]["Supplier_Code"].ToString()).Selected = true;
                    }


                    rbtnlistPOType.ClearSelection();

                    if (rbtnlistPOType.Items.FindByValue(dsLog.Tables[0].Rows[0]["PO_Type"].ToString()) != null)
                    {
                        rbtnlistPOType.Items.FindByValue(dsLog.Tables[0].Rows[0]["PO_Type"].ToString()).Selected = true;
                    }

                    rbtnlistCostType.ClearSelection();

                    if (rbtnlistCostType.Items.FindByValue(dsLog.Tables[0].Rows[0]["Cost_Type"].ToString()) != null)
                    {
                        rbtnlistCostType.Items.FindByValue(dsLog.Tables[0].Rows[0]["Cost_Type"].ToString()).Selected = true;
                    }

                    uc_SupplierList1.SelectedValue = dsLog.Tables[0].Rows[0]["PO_Supplier"].ToString();


                    ctlPortList1.SelectedValue = Convert.ToString(dsLog.Tables[0].Rows[0]["Port"]);


                    //ctlPortList1.SelectedValue = dsLog.Tables[0].Rows[0]["Port"].ToString();

                    gvAttachment.DataSource = BLL_PURC_LOG.Get_Log_Attachment(Request.QueryString["LOG_ID"]);
                    gvAttachment.DataBind();
                }
                catch { }

                dlReqsnPOs.DataSource = dsLog.Tables[1];
                dlReqsnPOs.DataBind();

                if (dsLog.Tables[2].Rows.Count == 0) // creating new PO
                {
                    ViewState["IsCreatingNewPO"] = true;
                    // create  rows based on vessels selected for logistic po
                    DataRow   dr;
                    DataTable dtVesselsInLPO = BLL_PURC_LOG.Get_VesselInLogisticPO(UDFLib.ConvertToInteger(Request.QueryString["LOG_ID"]));
                    if (dtVesselsInLPO.Rows.Count == 1)
                    {
                        dr              = dsLog.Tables[2].NewRow();
                        dr["item_id"]   = 0;
                        dr["vessel_id"] = 0;
                        dsLog.Tables[2].Rows.Add(dr);
                    }
                    else
                    {
                        foreach (DataRow drvsl in dtVesselsInLPO.Rows)
                        {
                            dr              = dsLog.Tables[2].NewRow();
                            dr["item_id"]   = 0;
                            dr["vessel_id"] = drvsl["vessel_id"];
                            dsLog.Tables[2].Rows.Add(dr);
                        }
                    }

                    gvItemList.DataSource = dsLog.Tables[2];
                    gvItemList.DataBind();


                    if (dsLog.Tables[1].Rows.Count == 1)// select single po option
                    {
                        rbtnlistPOType.Items.FindByValue("SPO").Selected = true;
                    }
                    else
                    {
                        rbtnlistPOType.Items.FindByValue("CPO").Selected = true;
                    }
                }
                else
                {
                    ViewState["IsCreatingNewPO"] = false;
                    gvItemList.DataSource        = dsLog.Tables[2];
                    gvItemList.DataBind();

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

                ViewState["dtGridItems"] = dsLog.Tables[2];


                lstUserList.DataSource = BLL_PURC_LOG.Get_Log_Logistic_Approver();
                lstUserList.DataBind();
                lstUserList.Items.Insert(0, new ListItem("SELECT", "0"));
                lstUserList.SelectedIndex = 0;
                ListItem itemrmv = lstUserList.Items.FindByValue(Session["userid"].ToString());
                lstUserList.Items.Remove(itemrmv);



                //ucPurcAttachment1.ReqsnNumber = Request.QueryString["LOG_ID"].ToString();
                //ucPurcAttachment1.UserID = Session["USERID"].ToString();
                //ucPurcAttachment1.FileUploadPath = Server.MapPath("../Uploads/Purchase");
                //ucPurcAttachment1.VesselID = "0";

                ASP.global_asax.AttachedFile = "";
                Session["PURCATTACHEDFILES"] = "";


                DataTable dtDeletedPOs = BLL_PURC_LOG.Get_Log_Deleted_LPO(Request.QueryString["LOG_ID"]);
                if (dtDeletedPOs.Rows.Count > 0)
                {
                    gvDeletedPOs.DataSource = dtDeletedPOs;
                    gvDeletedPOs.DataBind();
                }
                else
                {
                    lbllblexpand.Visible = false;
                    pnldeletedpo.Visible = false;
                }
            }


            if (IsPostBack)
            {
                // ucPurcAttachment1.Register_JS_Attach();
                Session["PURCATTACHEDFILES"] = ASP.global_asax.AttachedFile;
            }

            btnShowCnacelLPO.Visible = false;

            if (UDFLib.ConvertToInteger(Request.QueryString["IsApproving"]) == 0)
            {
                pnlApprove.Visible = false;
            }
            else
            {
                btnSavePODetails.Visible   = false;
                btnDeleteLO.Enabled        = false;
                btnSendForApproval.Visible = false;
                foreach (DataListItem item in dlReqsnPOs.Items)
                {
                    (item.FindControl("imgbtnDelete") as ImageButton).Visible = false;
                }

                foreach (GridViewRow gr in gvItemList.Rows)
                {
                    (gr.FindControl("imgbtnDeleteitem") as ImageButton).Visible = false;
                }
                (gvItemList.FooterRow.FindControl("btnAddNewItem") as Button).Visible = false;
            }

            if (UDFLib.ConvertToInteger(Request.QueryString["IsApproved"]) == 1)
            {
                pnlApprove.Visible         = false;
                btnSavePODetails.Visible   = false;
                btnDeleteLO.Enabled        = false;
                btnSendForApproval.Visible = false;
                foreach (DataListItem item in dlReqsnPOs.Items)
                {
                    (item.FindControl("imgbtnDelete") as ImageButton).Visible = false;
                }

                foreach (GridViewRow gr in gvItemList.Rows)
                {
                    (gr.FindControl("imgbtnDeleteitem") as ImageButton).Visible = false;
                    (gr.FindControl("ddlpovessels") as DropDownList).Enabled    = false;
                }
                (gvItemList.FooterRow.FindControl("btnAddNewItem") as Button).Visible = false;

                btnShowCnacelLPO.Visible = true;
            }


            DisableOnDeleted();
        }
    }