/// <summary>
        /// Date Created:   23/08/2011
        /// Created By:     Marco Abejar
        /// (description)   Load all details
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            //Label SFStatus = (Label)Master.FindControl("uclabelStatus");
            //SFStatus.Visible = false;

            if (GlobalCode.Field2String(Session["UserName"]) == "")
            {
                Response.Redirect("~/Login.aspx");
            }
            Session["strPrevPage"] = Request.RawUrl;
            if (!IsPostBack)
            {
                uoHiddenFieldContractID.Value = GlobalCode.Field2Int(Request.QueryString["cID"]).ToString();
                uoHiddenFieldVendorId.Value   = Request.QueryString["vmId"];
                uoHiddenFieldUserName.Value   = GlobalCode.Field2String(Session["UserName"]);

                int iContractID = GlobalCode.Field2Int(uoHiddenFieldContractID.Value);
                if (iContractID > 0)
                {
                    SafeguardBLL.GetVendorSafeguardContractByContractID(uoHiddenFieldContractID.Value, uoHiddenFieldVendorId.Value, 0);
                }
                else
                {
                    Session["ContractServiceDetailsAmt"]   = null;
                    Session["ContractSafeguardAttachment"] = null;
                }
                BindCurrency();
                BindSafeguardBranch(iContractID);
                if (iContractID == 0)
                {
                    BindServiceType(0, 0);
                }
                else
                {
                    BindServiceType(iContractID, 0);
                    BindAttachmentListView(iContractID, 0);
                }
                textChangeToUpperCase(uoDropDownListServiceType);

                BindServiceTypeDuration();
                BindContractServiceDetailsList();
            }
            Session["UserName"]     = uoHiddenFieldUserName.Value;
            uoButtonAddService.Text = uoHiddenFieldDetail.Value == "0" ? "Add" : "Save";
        }
Exemplo n.º 2
0
        /// <summary>
        /// Date Created: 18/08/2011
        /// Created By: Gabriel Oquialda
        /// (description) Get vendor vehicle contract detail
        /// </summary>
        public void vendorSafeguardGetContractDetail()
        {
            DataTable dt   = null;
            DataTable dtLV = null;
            DataTable dtSR = null;

            try
            {
                if (uoHiddenFieldContractId.Value == "")
                {
                    uoHiddenFieldContractId.Value = "0";
                }
                SafeguardBLL.GetVendorSafeguardContractByContractID(uoHiddenFieldContractId.Value, uoHiddenFieldBranchId.Value, 0);
                List <ContractSafeguardDetails> listDetails = new List <ContractSafeguardDetails>();
                listDetails = (List <ContractSafeguardDetails>)Session["SafeguardVendorDetails"];

                dt = getDataTable(listDetails);

                if (dt.Rows.Count > 0)
                {
                    ucLabelContractStatus.Text = dt.Rows[0]["ContractStatus"].ToString();
                    //uoTextBoxVendorCode.Text = dt.Rows[0]["BranchID"].ToString();
                    uotextboxRCCLRep.Text       = dt.Rows[0]["RCCLPersonnel"].ToString();
                    uotextboxVendorRep.Text     = dt.Rows[0]["VendorPersonnel"].ToString();
                    uoTextBoxTelNo.Text         = dt.Rows[0]["ContactNo"].ToString();
                    uoTextBoxEmailTo.Text       = dt.Rows[0]["EmailTo"].ToString();
                    uoTextBoxEmailCc.Text       = dt.Rows[0]["EmailCc"].ToString();
                    uoTextBoxContractTitle.Text = dt.Rows[0]["ContractName"].ToString();

                    string strContractStartDate = (dt.Rows[0]["ContractDateStart"].ToString().Length > 0)
                        ? String.Format("{0:MM/dd/yyyy HH:mm}", Convert.ToDateTime(dt.Rows[0]["ContractDateStart"].ToString()))
                        : "";
                    string strContractEndDate = (dt.Rows[0]["ContractDateEnd"].ToString().Length > 0)
                        ? String.Format("{0:MM/dd/yyyy HH:mm}", Convert.ToDateTime(dt.Rows[0]["ContractDateEnd"].ToString()))
                        : "";
                    uoTextBoxContractStartDate.Text = strContractStartDate;
                    uoTextBoxContractEndDate.Text   = strContractEndDate;

                    uoTextBoxRemarks.Text = dt.Rows[0]["Remarks"].ToString();

                    List <ContractServiceDetailsAmt> list = new List <ContractServiceDetailsAmt>();
                    list = GetContractSafeguardDetailsList();

                    uoGridViewVehicle.DataSource = getDataTable(list);;
                    uoGridViewVehicle.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (dtLV != null)
                {
                    dtLV.Dispose();
                }
                if (dtSR != null)
                {
                    dtSR.Dispose();
                }
            }
        }