예제 #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                serviceListData = (List <DocumentEL>)Session["services"];
                List <MCServiceSaleEntity> saleServiceEntity = new List <MCServiceSaleEntity>();
                if (serviceListData != null)
                {
                    foreach (DocumentEL item in serviceListData)
                    {
                        MCServiceSaleEntity mcsale = new MCServiceSaleEntity();
                        mcsale.ServiceID = item.DocumentID;
                        saleServiceEntity.Add(mcsale);
                    }
                }

                MCSaleEntity mcData = new MCSaleEntity();
                mcData.AddressOnCard   = txtAddressOnCard.Text;
                mcData.DotNo           = txtDOT.Text;
                mcData.Email           = txtRecieptEmail.Text;
                mcData.MCNo            = txtMC.Text;
                mcData.CardNo          = hidCardNo.Value;
                mcData.NameOnCard      = txtNameOnCard.Text;
                mcData.PhysicalAddress = txtPhysicalAddress.Text;
                mcData.serviceSaleData = saleServiceEntity;
                mcData.saleType        = SaleType.Submitted;
                mcData.SalesPersonID   = Convert.ToInt32(Request.Cookies["UserID"].Value);
                mcData.MCID            = Convert.ToInt32(Request.QueryString["MCID"]);
                mcData.ExpirationDate  = txtExpirationDate.Text;
                mcData.CVC             = txtCVC.Text;
                mcData.PhoneNo         = txtPhoneNo.Text;
                mcData.CardType        = ulcardtype.Attributes["class"];
                mcData.MCSaleNo        = Session["MCSaleNo"].ToString();
                mcData.LegalName       = txtLegalName.Text;
                mcData.DBA             = txtDBA.Text;
                mcData.DotPin          = txtDOTPin.Text;
                mcSalesHelper.AddMCSales(mcData);
                EmailHelper emailHelper = new EmailHelper();
                emailHelper.SendPlainEmail("New MC Sale Order", "A new sales order is been closed by " + Request.Cookies["Name"].Value + " (" + Request.Cookies["Email"].Value + "). Please login into admin panel to view orders.", "");
                Response.Write("<script>alert('Details Submitted Successfully.You cant edit them back.');</script>");
                Response.Redirect("ListSubmittedMCProfiles.aspx");
            }
            catch
            {
            }
        }
예제 #2
0
        protected void btnSaveDriver_Click(object sender, EventArgs e)
        {
            try
            {
                serviceListData = (List <DocumentEL>)Session["services"];
                List <MCServiceSaleEntity> saleServiceEntity = new List <MCServiceSaleEntity>();
                if (serviceListData != null)
                {
                    foreach (DocumentEL item in serviceListData)
                    {
                        MCServiceSaleEntity mcsale = new MCServiceSaleEntity();
                        mcsale.ServiceID = item.DocumentID;
                        saleServiceEntity.Add(mcsale);
                    }
                }

                MCSaleEntity mcData = new MCSaleEntity();
                mcData.AddressOnCard   = txtAddressOnCard.Text;
                mcData.DotNo           = txtDOT.Text;
                mcData.Email           = txtRecieptEmail.Text;
                mcData.MCNo            = txtMC.Text;
                mcData.PhoneNo         = txtPhoneNo.Text;
                mcData.NameOnCard      = txtNameOnCard.Text;
                mcData.PhysicalAddress = txtPhysicalAddress.Text;
                mcData.serviceSaleData = saleServiceEntity;
                mcData.saleType        = SaleType.Saved;
                mcData.CardNo          = hidCardNo.Value;
                mcData.SalesPersonID   = Convert.ToInt32(Request.Cookies["UserID"].Value);
                mcData.ExpirationDate  = txtExpirationDate.Text;
                mcData.CVC             = txtCVC.Text;
                mcData.MCSaleNo        = hidSaleNo.Value;
                mcData.CardType        = ulcardtype.Attributes["class"];
                mcData.PhoneNo         = txtPhoneNo.Text;
                mcData.LegalName       = txtLegalName.Text;
                mcData.DBA             = txtDBA.Text;
                mcData.DotPin          = txtDOTPin.Text;
                mcSalesHelper.AddMCSales(mcData);
                Session["services"] = null;
                Response.Redirect("ListSavedMCProfiles.aspx");
            }
            catch
            {
            }
        }
        protected void btnEditProfile_Click(object sender, EventArgs e)
        {
            int          MCID   = Convert.ToInt32(Request.QueryString["MCID"]);
            MCSaleEntity mcData = new MCSaleEntity();

            mcData.AddressOnCard   = txtAddressOnCard.Text;
            mcData.CardNo          = hidCardNo.Value;
            mcData.DotNo           = txtDOT.Text;
            mcData.Email           = txtRecieptEmail.Text;
            mcData.MCNo            = txtMC.Text;
            mcData.NameOnCard      = txtNameOnCard.Text;
            mcData.PhysicalAddress = txtPhysicalAddress.Text;
            mcData.MCID            = MCID;
            mcData.ExpirationDate  = txtExpirationDate.Text;
            mcData.CVC             = txtCVC.Text;
            mcData.PhoneNo         = txtPhoneNo.Text;
            mcData.CardType        = ulcardtype.Attributes["class"];
            mcData.MCSaleNo        = Session["MCSaleNo"].ToString();
            mcData.LegalName       = txtLegalName.Text;
            mcData.DBA             = txtDBA.Text;
            mcData.DotPin          = txtDOTPin.Text;
            if (Session["services"] != null)
            {
                serviceListData = (List <DocumentEL>)Session["services"];
                List <MCServiceSaleEntity> saleListEL = new List <MCServiceSaleEntity>();
                if (serviceListData != null)
                {
                    foreach (DocumentEL item in serviceListData)
                    {
                        MCServiceSaleEntity saleEL = new MCServiceSaleEntity();
                        saleEL.MCSaleID  = Convert.ToInt32(Request.QueryString["MCID"]);
                        saleEL.ServiceID = documentDal.GetDocumentTypeByName(item.DocumentTypeName).DocumentTypeID;
                        saleListEL.Add(saleEL);
                    }
                    mcData.serviceSaleData = saleListEL;
                }
            }
            mcSalesHelper.EditMCSales(mcData);
            Response.Redirect("ListMCSaleAdmin.aspx");
        }