Exemplo n.º 1
0
 protected void btnSerch_Click(object sender, EventArgs e)
 {
     AgreementTypeEntity entity = new AgreementTypeEntity();
     entity.AgreementType = rdoAgreementType.SelectedValue;
     entity.Title = txtTitle.Text;
     entity.BusinessTypeID = Convert.ToInt32(ddlBusinessType.SelectedIndex);
     AgreementTypeBI agreementType = new AgreementTypeBI();
     List<AgreementTypeEntity> list = agreementType.ReadSearchItem(entity);
     gvSearch.DataSource = list;
     gvSearch.DataBind();
 }
Exemplo n.º 2
0
 private void BindBussinessType()
 {
     AgreementTypeBI agreementType = new AgreementTypeBI();
     List<AgreementTypeEntity> list = agreementType.ReadList();
     ddlBusinessType.DataSource = list;
     ddlBusinessType.DataValueField = "BusinessTypeID";
     ddlBusinessType.DataTextField = "BusinessType";
     ddlBusinessType.DataBind();
     Application["BusinessType"] = list;
     ListItem item = new ListItem("--Select--", "");
     ddlBusinessType.Items.Insert(0, item);
 }
Exemplo n.º 3
0
        protected void btnReject_Click(object sender, EventArgs e)
        {
            ApprovalEntity entity = new ApprovalEntity();

            entity.AgreementTypeID = SessionManager.AgreementTypeID;
            entity.ApprovalID = SessionManager.ApprovalID;
            entity.Comments = txtComment.Text.Trim();
            entity.Actions = txtAction.Text.Trim();
            entity.Status = "R";

            ApprovalBI approver = new ApprovalBI();
            approver.Insert(entity);

            /*#TODO:Get user's email id based on the agreement id.*/
            AgreementTypeBI agreementTypeBI = new AgreementTypeBI();
            AgreementTypeEntity agreemententity = agreementTypeBI.ReadTitle(SessionManager.AgreementTypeID);

            string email = agreemententity.Email;
            string agreementTitle = agreemententity.Title;

            string approverName = SessionManager.UsersEntity.FullName;
            string body = null;

            //body =
            using (StreamReader sr = new StreamReader(Server.MapPath("Templates\\EmailTemplete.txt")))
            {
                body = sr.ReadToEnd();
            }

            body = body.Replace("[APPROVER_NAME]", approverName);
            body = body.Replace("[AGREEMENT_TITLE]", agreementTitle);
            body = body.Replace("[APPROVER_NAME]", approverName);
            body = body.Replace("[COMMENTS]", txtComment.Text.Trim());
            body = body.Replace("[ACTIONS]", txtAction.Text.Trim());

            EmailHelper.SendEmail(new List<string>() { email }, agreementTitle + " Agreement Rejected", body, null);

            ClientScript.RegisterStartupScript(Page.GetType(), "_Rejected_", "alert('Agreement Rejected');window.location='home.aspx';", true);
            //ClearData();

            //btnApprove.Visible = false;
            //btnReject.Visible = false;
            //btnCancel.Text = "Go To Home";
        }
        private void Status()
        {
            Page.Validate("Next");
            int agreementTypeStatus = 0;
            if (Page.IsValid)
            {
                agreementTypeStatus = 1;

            }
            else
            {
                agreementTypeStatus = 0;

            }
            AgreementTypeBI agreementTypeBI = new AgreementTypeBI();
            agreementTypeBI.InsertStatus(agreementTypeStatus, SessionManager.AgreementTypeID);
        }
        private int SaveData()
        {
            AgreementTypeEntity entity = new AgreementTypeEntity();
            if (SessionManager.AgreementTypeID != 0)
                entity.AgreementTypeID = SessionManager.AgreementTypeID;
            entity.UserID = SessionManager.UsersID;

            entity.AgreementType = rdoAgreementType.SelectedValue;
            if (rdoAgreementType.SelectedValue == "A")
            {
                entity.WorkType = rdoWorkType.SelectedValue;
                entity.Title = txtTitle.Text;
                entity.BusinessTypeID = Convert.ToInt32(ddlBusinessType.SelectedValue);
            }
            else
            {
                entity.VendorID = ddlRegisteredVendor.SelectedIndex;
                entity.Title = txtTitleRegistered.Text;
                entity.USTaxIdentificationNo = txtTaxIdentification.Text;
                entity.UNIQUENo = txtUNIQUE.Text;
                entity.TechnicalInformation = rdotechnical.SelectedValue;
            }
            AgreementTypeBI agreementType = new AgreementTypeBI();

            int agreementTypeID = agreementType.Insert(entity);
            return agreementTypeID;
        }
 private void LoadAgreementType(int agreementId)
 {
     AgreementTypeBI agreementType = new AgreementTypeBI();
     AgreementTypeEntity entity = agreementType.Read(agreementId);
     if (entity != null)
     {
         /*Assign Values to controls*/
         if (entity.AgreementType == "A")
         {
             BindBusinessType();
             panelAnonymousVendor.Visible = true;
             rdoAgreementType.SelectedValue = entity.AgreementType;
             rdoWorkType.SelectedValue = entity.WorkType;
             txtTitle.Text = entity.Title;
             //  ddlBusinessType.SelectedValue = entity.BusinessType;
             ddlBusinessType.SelectedIndex = (entity.BusinessTypeID);
         }
         else
         {
             /* to disable eligibility link */
             LinkButton lnkEligibility = (LinkButton)Navigator1.FindControl("lnkEligibility");
             lnkEligibility.Visible = false;
             // bind register venders
             BindRegisteredVendor();
             panelRegisteredVendor.Visible = true;
             SessionManager.AgreementType = "R";
             rdoAgreementType.SelectedValue = entity.AgreementType;
             ddlRegisteredVendor.SelectedIndex = entity.VendorID;
             txtTitleRegistered.Text = entity.Title;
             txtTaxIdentification.Text = entity.USTaxIdentificationNo;
             txtUNIQUE.Text = entity.UNIQUENo;
             rdotechnical.SelectedValue = entity.TechnicalInformation;
             ddlRegisteredVendor_SelectedIndexChanged(null, null);
         }
     }
 }