コード例 #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Options options = new Options();

            options.ApiKey    = "apikey";
            options.SecretKey = "secretkey";
            options.BaseUrl   = "https://sandbox-api.iyzipay.com";

            CreateCheckoutFormInitializeRequest request = new CreateCheckoutFormInitializeRequest();

            request.Locale         = Locale.TR.ToString();
            request.ConversationId = "123456789";
            request.Price          = "1";
            request.PaidPrice      = "1.2";
            request.Currency       = Currency.TRY.ToString();
            request.BasketId       = "B67832";
            request.PaymentGroup   = PaymentGroup.PRODUCT.ToString();
            //request.CallbackUrl = "https://www.merchant.com/callback";
            request.CallbackUrl = HttpContext.Current.Request.Url.AbsoluteUri;

            List <int> enabledInstallments = new List <int>();

            enabledInstallments.Add(2);
            enabledInstallments.Add(3);
            enabledInstallments.Add(6);
            enabledInstallments.Add(9);
            request.EnabledInstallments = enabledInstallments;

            Buyer buyer = new Buyer();

            buyer.Id                  = "BY789";
            buyer.Name                = "John";
            buyer.Surname             = "Doe";
            buyer.GsmNumber           = "+905350000000";
            buyer.Email               = "*****@*****.**";
            buyer.IdentityNumber      = "74300864791";
            buyer.LastLoginDate       = "2015-10-05 12:43:35";
            buyer.RegistrationDate    = "2013-04-21 15:12:09";
            buyer.RegistrationAddress = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
            buyer.Ip                  = "85.34.78.112";
            buyer.City                = "Istanbul";
            buyer.Country             = "Turkey";
            buyer.ZipCode             = "34732";
            request.Buyer             = buyer;

            Address shippingAddress = new Address();

            shippingAddress.ContactName = "Jane Doe";
            shippingAddress.City        = "Istanbul";
            shippingAddress.Country     = "Turkey";
            shippingAddress.Description = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
            shippingAddress.ZipCode     = "34742";
            request.ShippingAddress     = shippingAddress;

            Address billingAddress = new Address();

            billingAddress.ContactName = "Jane Doe";
            billingAddress.City        = "Istanbul";
            billingAddress.Country     = "Turkey";
            billingAddress.Description = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
            billingAddress.ZipCode     = "34742";
            request.BillingAddress     = billingAddress;

            List <BasketItem> basketItems     = new List <BasketItem>();
            BasketItem        firstBasketItem = new BasketItem();

            firstBasketItem.Id        = "BI101";
            firstBasketItem.Name      = "Binocular";
            firstBasketItem.Category1 = "Collectibles";
            firstBasketItem.Category2 = "Accessories";
            firstBasketItem.ItemType  = BasketItemType.PHYSICAL.ToString();
            firstBasketItem.Price     = "0.3";
            basketItems.Add(firstBasketItem);

            BasketItem secondBasketItem = new BasketItem();

            secondBasketItem.Id        = "BI102";
            secondBasketItem.Name      = "Game code";
            secondBasketItem.Category1 = "Game";
            secondBasketItem.Category2 = "Online Game Items";
            secondBasketItem.ItemType  = BasketItemType.VIRTUAL.ToString();
            secondBasketItem.Price     = "0.5";
            basketItems.Add(secondBasketItem);

            BasketItem thirdBasketItem = new BasketItem();

            thirdBasketItem.Id        = "BI103";
            thirdBasketItem.Name      = "Usb";
            thirdBasketItem.Category1 = "Electronics";
            thirdBasketItem.Category2 = "Usb / Cable";
            thirdBasketItem.ItemType  = BasketItemType.PHYSICAL.ToString();
            thirdBasketItem.Price     = "0.2";
            basketItems.Add(thirdBasketItem);
            request.BasketItems = basketItems;

            CheckoutFormInitialize checkoutFormInitialize = CheckoutFormInitialize.Create(request, options);

            ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", checkoutFormInitialize.CheckoutFormContent);

            odendiMi = checkoutFormInitialize.Status;
        }
コード例 #2
0
        void btnko_Click(object sender, EventArgs e)
        {
            try
            {
                using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString))
                {
                    var tp = from a in db.CommitDirector
                             where a.CommitInHead.CommitInAssets.CommitInTest.CommitInMaterialsLeader.CommitInMaterials.CommitProduce.StorageInID == Convert.ToInt32(Request.QueryString["StorageInID"]) && a.CommitInHead.CommitInAssets.CommitInTest.CommitInMaterialsLeader.CommitInMaterials.CommitProduce.BatchIndex == Request.QueryString["QCBatch"].ToString()
                             select a;
                    if (tp.ToArray().Length > 0)
                    {
                        ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('不能重复插入记录! ')</script>");
                        return;
                    }


                    if (this.checkPass.Checked)
                    {
                        for (int i = 0; i < this.gv.Rows.Count; i++)
                        {
                            CommitDirector sih = new CommitDirector();
                            sih.HeadID  = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 1].Text.ToString());
                            sih.Approve = "是";
                            var SevTime = db.ExecuteQuery <DateTime>("select  getdate()", new object[] { });
                            sih.CreateTime = SevTime.First();
                            sih.Creator    = reEmpId(SPContext.Current.Web.CurrentUser.LoginName);
                            db.CommitDirector.InsertOnSubmit(sih);
                            db.SubmitChanges();


                            //写入线下数据库
                            TableOfStocks tos = new TableOfStocks();
                            tos.StorageInID        = Convert.ToInt32(Request.QueryString["StorageInID"]);
                            tos.StorageInType      = "委外入库";
                            tos.MaterialID         = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 4].Text.ToString());
                            tos.MaterialCode       = "N/A";
                            tos.QuantityGentaojian = Convert.ToDecimal(this.gv.Rows[i].Cells[4].Text.ToString());
                            tos.QuantityMetre      = Convert.ToDecimal(this.gv.Rows[i].Cells[5].Text.ToString());
                            tos.QuantityTon        = Convert.ToDecimal(this.gv.Rows[i].Cells[6].Text.ToString());
                            tos.CurUnit            = this.gv.Rows[i].Cells[7].Text.ToString();
                            tos.UnitPrice          = Convert.ToDecimal(this.gv.Rows[i].Cells[8].Text.ToString());
                            tos.Amount             = Convert.ToDecimal(this.gv.Rows[i].Cells[9].Text.ToString());
                            tos.ExpectedProject    = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 5].Text.ToString());
                            tos.Remark             = this.gv.Rows[i].Cells[12].Text.ToString();
                            tos.BatchIndex         = _QCbatch;
                            tos.ManufacturerID     = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 3].Text.ToString());
                            tos.SupplierID         = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 2].Text.ToString());
                            tos.PileID             = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 6].Text.ToString());
                            tos.StorageID          = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 9].Text.ToString());
                            tos.MaterialsManager   = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 7].Text.ToString());
                            tos.AssetsManager      = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 8].Text.ToString());


                            tos.ReceivingTypeName = this.gv.Rows[i].Cells[this.gv.Columns.Count - 12].Text.ToString();
                            tos.StorageInCode     = this.gv.Rows[i].Cells[this.gv.Columns.Count - 11].Text.ToString();
                            tos.BillCode          = this.gv.Rows[i].Cells[this.gv.Columns.Count - 10].Text.ToString();

                            tos.StorageTime = Convert.ToDateTime(this.gv.Rows[i].Cells[14].Text.ToString());
                            var Time = db.ExecuteQuery <DateTime>("select  getdate()", new object[] { });
                            tos.CreateTime = Time.First();
                            tos.Creator    = reEmpId(SPContext.Current.Web.CurrentUser.LoginName);

                            db.TableOfStocks.InsertOnSubmit(tos);
                            db.SubmitChanges();

                            //修改人物完成状态
                            TaskStorageIn tsi = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID == _taskID);
                            tsi.TaskState = "已完成";
                            db.SubmitChanges();
                        }
                        btnko.Enabled     = false;
                        checkPass.Enabled = false;
                    }
                    else
                    {
                        //审核不通过,回退操作

                        //删除写入的数据
                        var temp = from a in db.CommitDirector
                                   where a.CommitInHead.CommitInAssets.CommitInTest.CommitInMaterialsLeader.CommitInMaterials.CommitProduce.StorageInID == Convert.ToInt32(Request.QueryString["StorageInID"]) && a.CommitInHead.CommitInAssets.CommitInTest.CommitInMaterialsLeader.CommitInMaterials.CommitProduce.BatchIndex == Request.QueryString["QCBatch"].ToString()
                                   select new { a.StorageInDirectorID };
                        var li = temp.ToList();

                        for (int i = 0; i < li.Count; i++)
                        {
                            CommitDirector sd = db.CommitDirector.SingleOrDefault(u => u.StorageInDirectorID == li[i].StorageInDirectorID);
                            if (sd != null)
                            {
                                db.CommitDirector.DeleteOnSubmit(sd);
                                db.SubmitChanges();
                            }
                        }

                        //回发任务
                        //原任务
                        TaskStorageIn tsi = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID == _taskID);
                        tsi.TaskState    = "已完成";
                        tsi.InspectState = "已审核";


                        //新任务
                        TaskStorageIn TSI = new TaskStorageIn();

                        TSI.TaskCreaterID = reEmpId(SPContext.Current.Web.CurrentUser.LoginName);
                        TSI.TaskTargetID  = tsi.TaskCreaterID;
                        if (TSI.TaskTargetID == 0)
                        {
                            ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('不存在质检用户,请同步AD账户 ')</script>");
                            return;
                        }

                        TSI.StorageInID   = Convert.ToInt32(Request.QueryString["StorageInID"]);
                        TSI.StorageInType = "委外入库";
                        TSI.TaskTitle     = tsi.TaskTitle + "(主任审批未通过)";
                        TSI.TaskState     = "未完成";
                        TSI.TaskDispose   = "未废弃";
                        TSI.TaskType      = "资产组长";
                        TSI.InspectState  = "驳回";

                        //TSI.BatchOfIndex = this.ddlbatch.SelectedItem.Text.ToString();

                        TSI.QCBatch = _QCbatch;


                        TSI.Remark = "审核未通过";
                        var Sev = db.ExecuteQuery <DateTime>("select  getdate()", new object[] { });
                        TSI.CreateTime = Sev.First();

                        db.TaskStorageIn.InsertOnSubmit(TSI);
                        db.SubmitChanges();
                        Response.Redirect("../../default-old.aspx", false);
                    }
                    //存库标识
                    ViewState["Temp"] = flag = true;
                }
                //Response.Redirect("QualifiedManage.aspx?StorageInID=" + Request.QueryString["StorageInID"] + "&&TaskStorageID=" + Request.QueryString["TaskStorageID"] + "&&QCBatch=" + Request.QueryString["QCBatch"] + " ");
            }
            catch (Exception ex)
            {
                MethodBase    mb      = MethodBase.GetCurrentMethod();
                LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name));
                ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_INSERTERROR));
            }
        }
コード例 #3
0
 protected void btn_close_Click(object sender, EventArgs e)
 {
     ClientScript.RegisterClientScriptBlock(Page.GetType(), "script", "window.close()", true);
 }
コード例 #4
0
    protected void create_Click(object sender, EventArgs e)
    {
        List <UserInfo> allUsersList = Application["AllUsersList"] as List <UserInfo>;
        UserInfo        currentuser  = new UserInfo();

        currentuser.EmailAddress           = textEmail.Text;
        currentuser.FirstName              = textFirst.Text;
        currentuser.LastName               = textLast.Text;
        currentuser.Password               = passwordText.Text;
        currentuser.SchoolDistrictName     = textSchoolDis.Text;
        currentuser.StateOrProvince        = stateList.Text;
        currentuser.SecurityQuestion       = securityList.Text;
        currentuser.SecurityQuestionAnswer = securityText.Text;
        allUsersList.Add(currentuser);


        String firstName = currentuser.FirstName;
        String lastName  = currentuser.LastName;

        String msgBody = "Dear " + firstName + " " + lastName + ", <br/><br/>" +
                         "Thank you for signing up with us. <br/><br/>" +
                         "You can now access your student school account at http://dcm.uhcl.edu/c432017sp02grimesa/login.aspx <br/><br/>" +
                         "Thank you again for you Signing Up. If you have any questions, please contact <br/>" +
                         "us at http://dcm.uhcl.edu/c432017sp02grimesa/connect.aspx <br/><br/>" +
                         "With Best Wishes, <br/><br/>" +
                         "Gateway School Account Administration Team.";
        String msgSubject = "New Signing Up Notification!";

        MailMessage mailObj = new MailMessage();

        mailObj.Body = msgBody;
        mailObj.From = new MailAddress("*****@*****.**", "Student Account Team");
        mailObj.To.Add(new MailAddress(textEmail.Text));
        mailObj.Subject    = msgSubject;
        mailObj.IsBodyHtml = true;


        SmtpClient SMTPClient = new System.Net.Mail.SmtpClient();

        SMTPClient.Host        = "smtp.gmail.com";
        SMTPClient.Port        = 587;
        SMTPClient.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hello32!");
        SMTPClient.EnableSsl   = true;

        try
        {
            SMTPClient.Send(mailObj);
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage",
                                                "alert('Error.')", true);
        }


        string script = "<script type=\"text/javascript\">alert('Thank you for signing up. You can now login using the Log In option. An email has also been sent to the email address you provided during Sign Up.'); window.open('login.aspx')</script>";

        ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script);

        SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString);

        string insertInfo = "INSERT INTO GrimesA_WADsp17_UserInfo (EmailAddress, Password, FirstName, LastName," +
                            "SecurityQuestion,SecurityQAnswer,StateOrProvince,SchoolDistName) VALUES( '" + textEmail.Text + "', '" +
                            passwordText.Text + "', '" +
                            textFirst.Text + "', '" +
                            textLast.Text + "', '" +
                            securityList.Text + "','" +
                            securityText.Text + "','" +
                            stateList.Text + "','" +
                            textSchoolDis.Text + "')";

        SqlCommand sqlcommand = new SqlCommand(insertInfo, con);

        try
        {
            con.Open();

            sqlcommand.ExecuteNonQuery();
        }
        finally
        {
            con.Close();
        }
    }
コード例 #5
0
    protected void grdImportDetails_ItemCommand(object source, Telerik.WebControls.GridCommandEventArgs e)
    {
        try
        {
            if (e.CommandName == "UpdateAll")
            {
                //First store modifications made in this page to the dataset
                StoreValuesToDataSet();

                List <AnnualImportDetails> imList = new List <AnnualImportDetails>();

                foreach (DataRow row in DsLogs.Tables[0].Rows)
                {
                    AnnualImportDetails importDetails = new AnnualImportDetails(CurrentConnectionManager);
                    importDetails.IdImport      = (int)row["IdImport"];
                    importDetails.IdRow         = (int)row["IdRow"];
                    importDetails.CostCenter    = (row["CostCenter"] == DBNull.Value) ? string.Empty : row["CostCenter"].ToString();
                    importDetails.ProjectCode   = (row["ProjectCode"] == DBNull.Value) ? string.Empty : row["ProjectCode"].ToString();
                    importDetails.WPCode        = (row["WPCode"] == DBNull.Value) ? string.Empty : row["WPCode"].ToString();
                    importDetails.AccountNumber = (row["AccountNumber"] == DBNull.Value) ? string.Empty : row["AccountNumber"].ToString();
                    if (row["Quantity"] != DBNull.Value)
                    {
                        importDetails.Quantity = (decimal)row["Quantity"];
                    }
                    if (row["Value"] != DBNull.Value)
                    {
                        importDetails.Value = (decimal)row["Value"];
                    }
                    if (row["CurrencyCode"] != DBNull.Value)
                    {
                        importDetails.CurrencyCode = row["CurrencyCode"].ToString();
                    }
                    if (row["Date"] != DBNull.Value)
                    {
                        importDetails.ImportDate = (DateTime)row["Date"];
                    }
                    imList.Add(importDetails);
                }

                if (imList.Count > 0)
                {
                    AnnualImportDetails annualImportDetails = new AnnualImportDetails(CurrentConnectionManager);
                    DataSet             dsNewCreatedFile    = annualImportDetails.UpdateBatchImportDetails(imList);

                    //After saving, remove the previous information from the session so that the old data (from the annual logs)
                    //is loaded from the db
                    DsLogs = null;
                    LoadEditableGrid();

                    CreateNewFile(dsNewCreatedFile);
                }

                if (!Page.ClientScript.IsClientScriptBlockRegistered(this.Page.GetType(), "ButtonUpdateClick"))
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "ButtonUpdateClick", "window.returnValue = 1; window.close();", true);
                }
            }
            //When changing the page, we need to store any possible modifications made to the current page in the underlying datasource of the
            //grid
            if (e.CommandName == "Page")
            {
                StoreValuesToDataSet();
            }
        }
        catch (IndException indExc)
        {
            SaveSuccessful = false;
            ShowError(indExc);
        }
        catch (Exception exc)
        {
            SaveSuccessful = false;
            ShowError(new IndException(exc));
        }
        finally
        {
            if (!ClientScript.IsClientScriptBlockRegistered(this.GetType(), "ResizePopUp"))
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "ResizePopUp", "SetPopUpHeight();", true);
            }
        }
    }
コード例 #6
0
 public void WebAlart(string t)
 {
     ClientScript.RegisterClientScriptBlock(this.GetType(), "key", "<script>alert('" + t + "');</script>");
 }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Initial Code just to hide left hand side panel for this page.
            var masterPage = (TecnicianManualEntry)Page.Master;

            if (masterPage != null)
            {
                masterPage.HideLeftContainer = true;
            }

            var accountRepository = IoC.Resolve <ICorporateAccountRepository>();
            var account           = accountRepository.GetbyEventId(EventId);

            CaptureHaf = (account == null || account.CaptureHaf);

            CapturePcpConsent = (account != null && account.CapturePcpConsent);
            IsHealthPlanEvent = (account != null && account.IsHealthPlan);


            //var communicationRepository = IoC.Resolve<ICommunicationRepository>();
            EventCustomer eventCustomer = null;

            //var lastCommentAdded = communicationRepository.GetCommentsforPhysician(CustomerId, EventId);

            if (!IsPostBack)
            {
                var setting          = IoC.Resolve <ISettings>();
                var eventsRepository = IoC.Resolve <IEventRepository>();
                var eventData        = eventsRepository.GetById(EventId);
                eventCustomer = IoC.Resolve <IEventCustomerRepository>().Get(EventId, CustomerId);
                var eventCustomerId = eventCustomer.Id;

                var purchasedTest       = IoC.Resolve <ITestResultService>().TestPurchasedByCustomer(eventCustomerId);
                var iseawvTestPurchased = IsEawvTestPurchased = purchasedTest != null?purchasedTest.Any(x => x.Id == (long)TestType.eAWV) : false;

                IsNewResultFlow = eventData.EventDate >= setting.ResultFlowChangeDate;
                if (IsNewResultFlow)
                {
                    ClientScript.RegisterHiddenField("IsNewResultFlowInputHidden", "true");
                }
                else
                {
                    ClientScript.RegisterHiddenField("IsNewResultFlowInputHidden", "false");
                }

                var questionnaireType = QuestionnaireType.None;
                if (account != null && account.IsHealthPlan && eventData != null)
                {
                    questionnaireType = IoC.Resolve <IAccountHraChatQuestionnaireHistoryServices>().QuestionnaireTypeByAccountIdandEventDate(account.Id, eventData.EventDate);
                }

                var isShowHraQuestioner = questionnaireType == QuestionnaireType.HraQuestionnaire;

                if (eventData.EventDate < setting.ChecklistChangeDate)
                {
                    ShowCheckList = (account != null && account.PrintCheckList);
                }

                var mediaLocation = IoC.Resolve <IMediaRepository>().GetResultMediaFileLocation(CustomerId, EventId);
                ClientScript.RegisterClientScriptBlock(Page.GetType(), "js_Location_Url", "function getLocationPrefix() { return '" + mediaLocation.PhysicalPath.Replace("\\", "\\\\") + "'; } function getUrlPrefix() { return '" + mediaLocation.Url + "'; }", true);

                GetConductedbyData(eventData);
                FillStates();

                var currentSession = IoC.Resolve <ISessionContext>();

                ClientScript.RegisterHiddenField("hfTechnicianId", currentSession.UserSession.CurrentOrganizationRole.OrganizationRoleUserId.ToString());
                ClientScript.RegisterHiddenField("hfOrganizationId", currentSession.UserSession.CurrentOrganizationRole.OrganizationId.ToString());

                string pageHeading = "";

                var basicBiometricCutOfDate = setting.BasicBiometricCutOfDate;
                var hideBasicBiometric      = (eventData.EventDate.Date >= basicBiometricCutOfDate);
                ShowHideFastingStatus           = (eventData.EventDate.Date >= setting.FastingStatusDate);
                BasicBiometric.ShowByCutOffDate = !hideBasicBiometric;

                TestSection.SetSectionShowHide(hideBasicBiometric);

                if (currentSession != null && currentSession.UserSession != null && currentSession.UserSession.CurrentOrganizationRole != null)
                {
                    RoleId = currentSession.UserSession.CurrentOrganizationRole.GetSystemRoleId;
                }


                if (Mode == EditResultMode.ResultCorrection)
                {
                    var result = new CommunicationRepository().GetPhysicianandCommentsforFranchisee(CustomerId, EventId);
                    if (!string.IsNullOrEmpty(result.SecondValue))
                    {
                        PhysicianCommentsDiv.Visible = true;
                        PhysicianCommentsMessageBox.ShowErrorMessage("<b><u>Physician Comments:</u> </b>" + result.SecondValue);
                    }

                    updateWithCorrectionDivTop.Visible = true;
                    saveDivTop.Visible    = false;
                    approveDivtop.Visible = false;

                    updateWithCorrectionsDivbottom.Visible = true;
                    saveDivbottom.Visible    = false;
                    approveDivbottom.Visible = false;

                    var physicianService = IoC.Resolve <IPhysicianAssignmentService>();
                    var physicianIds     = physicianService.GetPhysicianIdsAssignedtoaCustomer(EventId, CustomerId);
                    if (physicianIds != null && result.FirstValue > 0 && physicianIds.Count() == 2 && physicianIds.ElementAt(1) == result.FirstValue)
                    {
                        SendToOvereadPhysician = true;
                    }

                    ClientScript.RegisterHiddenField("ResultStatusInputHidden", "4");

                    pageHeading = "Results Update/Correction";
                }


                if (Mode == EditResultMode.ResultPreAudit) // && isTechTeamConfigured == true)
                {
                    ClientScript.RegisterHiddenField("ResultStatusInputHidden", "4");
                    pageHeading = "Results Pre Audit";

                    saveDivTop.Visible    = false;
                    saveDivbottom.Visible = false;

                    if (TestSection.ContainsReviewableTests && !IsNewResultFlow)
                    {
                        skipevaluationdivbottom.Visible = true;
                    }

                    var customerHealthInfo = IoC.Resolve <IHealthAssessmentRepository>().Get(CustomerId, EventId);
                    if (!CaptureHaf || (customerHealthInfo != null && customerHealthInfo.Any()))
                    {
                        ClientScript.RegisterStartupScript(Page.GetType(), "js_setmedicalhistory", "setMedicalHistory();", true);
                    }

                    var defaultPhysician = IoC.Resolve <IPhysicianRepository>().GetDefaultPhysicianforEvent(EventId);
                    ClientScript.RegisterHiddenField("DefaultPhysician", defaultPhysician.ToString());

                    //var eventCustomerId = IoC.Resolve<IEventCustomerRepository>().Get(EventId, CustomerId).Id;
                    var isCustomerSkipped = IoC.Resolve <IPhysicianEvaluationRepository>().IsMarkedReviewSkip(eventCustomerId);
                    if (isCustomerSkipped)
                    {
                        ClientScript.RegisterStartupScript(Page.GetType(), "js_markcustomerskipped", "$('#skipevaluationcheckbox').attr('checked', true);", true);
                    }
                }
                else if (Mode == EditResultMode.ResultEntry)
                {
                    if (IsNewResultFlow)
                    {
                        ClientScript.RegisterHiddenField("ResultStatusInputHidden", "2");
                    }
                    else
                    {
                        ClientScript.RegisterHiddenField("ResultStatusInputHidden", "3");
                    }

                    pageHeading = "Results Edit/Entry";

                    approveDivtop.Visible    = false;
                    approveDivbottom.Visible = false;
                }

                HeadingSpan.InnerHtml = pageHeading;

                if (Request.UrlReferrer.AbsolutePath.ToLower().IndexOf("auditresultentry.aspx") < 0)
                {
                    Session["ReferredUrlFirstTimeOpen"] = Request.UrlReferrer;
                }

                CreateIFJSArrays();
                CreateJsArrayforIfuCs();

                //var eventCustomerRepository = IoC.Resolve<IEventCustomerRepository>();
                var goBackToResultEnteryPage = false;

                EventCustomerResult eventCustomerResult = IoC.Resolve <IEventCustomerResultRepository>().GetByCustomerIdAndEventId(CustomerId, EventId);;

                if ((Mode == EditResultMode.ResultEntry))
                {
                    if (IsCustomerNoShowOrLeftWithoutScreening(eventCustomer))
                    {
                        ClientScript.RegisterStartupScript(Page.GetType(), "js_NextCustomer", "customerMarkNoShow();", true);
                        goBackToResultEnteryPage = true;
                    }
                    else
                    {
                        var nextCustomerId = new TestResultRepository().GetNextCustomerEntryandAudit(EventId, CustomerId, IsNewResultFlow);
                        ClientScript.RegisterStartupScript(Page.GetType(), "js_NextCustomer", "setnextCustomerId(" + nextCustomerId + ");", true);
                    }
                }
                else
                {
                    var isChartSignedOff  = true;
                    var isQvTestPurchased = purchasedTest != null?purchasedTest.Any(x => x.Id == (long)TestType.Qv) : false;

                    var isHraQuestionnaire = questionnaireType == QuestionnaireType.HraQuestionnaire;

                    if (questionnaireType == QuestionnaireType.ChatQuestionnaire)
                    {
                        isChartSignedOff = isQvTestPurchased || (eventCustomerResult != null && eventCustomerResult.SignedOffBy.HasValue);
                    }
                    else
                    {
                        var isEawvTestNotPerformed = IoC.Resolve <ITestNotPerformedRepository>().IsTestNotPerformed(eventCustomer.Id, (long)TestType.eAWV);
                        isChartSignedOff = (eventCustomerResult != null && eventCustomerResult.SignedOffBy.HasValue) || !isShowHraQuestioner || !iseawvTestPurchased || isEawvTestNotPerformed;
                    }
                    IsChartSignedOff = (eventCustomerResult != null && eventCustomerResult.SignedOffBy.HasValue);
                    if (!IsNewResultFlow || isChartSignedOff)
                    {
                        if (IsCustomerNoShowOrLeftWithoutScreening(eventCustomer))
                        {
                            ClientScript.RegisterStartupScript(Page.GetType(), "js_NextCustomer", "customerMarkNoShow();", true);
                            goBackToResultEnteryPage = true;
                        }
                        else
                        {
                            long nextCustomerId = 0;
                            if (IsNewResultFlow && account != null && (questionnaireType != QuestionnaireType.None))
                            {
                                nextCustomerId = new TestResultRepository().GetNextCustomerForPreAudit(EventId, CustomerId, isHraQuestionnaire);
                            }
                            else
                            {
                                nextCustomerId = new TestResultRepository().GetNextCustomerEntryandAudit(EventId, CustomerId, IsNewResultFlow);
                            }

                            ClientScript.RegisterStartupScript(Page.GetType(), "js_NextCustomer", "setnextCustomerId(" + nextCustomerId + ");", true);
                        }
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(Page.GetType(), "js_NextCustomer", "customerChartIsUnsigned();", true);
                    }

                    //if (eventCustomerResult != null && IsNewResultFlow)
                    //{
                    //    var notes = communicationRepository.GetNotesForReversal(eventCustomerResult.Id);
                    //    if (!string.IsNullOrWhiteSpace(notes))
                    //    {
                    //        revertBackNotes.Visible = true;
                    //        ReasonToRevert.InnerText = notes;
                    //    }
                    //}
                }

                if (!goBackToResultEnteryPage)
                {
                    if (eventCustomerResult != null)
                    {
                        //LogAudit(ModelType.View, eventCustomerResult);
                        var priorityInQueue =
                            IoC.Resolve <IPriorityInQueueRepository>().GetByEventCustomerResultId(eventCustomerResult.Id);
                        if (priorityInQueue != null && priorityInQueue.InQueuePriority > 0)
                        {
                            if (!CurrentOrgUser.CheckRole((long)Roles.Technician))
                            {
                                PriorityInQueueCheckbox.Checked = true;
                            }

                            if (priorityInQueue.NoteId == null)
                            {
                                return;
                            }
                            var noteText = IoC.Resolve <INotesRepository>().Get(priorityInQueue.NoteId.Value);
                            if (noteText != null && !string.IsNullOrEmpty(noteText.Text))
                            {
                                PriorityInQueueText.InnerText = noteText.Text;
                                PriorityInQueueReasonDisplayDiv.Style.Add(HtmlTextWriterStyle.Display, "block");
                            }
                            else if (!CurrentOrgUser.CheckRole((long)Roles.Technician))
                            {
                                PriorityInQueueReasonDisplayDiv.Style.Add(HtmlTextWriterStyle.Display, "block");
                            }
                        }
                        else
                        {
                            PriorityInQueueCheckbox.Checked = false;
                            PriorityInQueueReasonDisplayDiv.Style.Add(HtmlTextWriterStyle.Display, "none");
                        }
                    }
                    else
                    {
                        PriorityInQueueCheckbox.Checked = false;
                        PriorityInQueueReasonDisplayDiv.Style.Add(HtmlTextWriterStyle.Display, "none");
                    }
                }
            }
        }
コード例 #8
0
    public void SendmailAuth(int autid)
    {
        try
        {
            System.Net.Mail.SmtpClient  Client  = new System.Net.Mail.SmtpClient();
            System.Net.Mail.MailMessage Message = new System.Net.Mail.MailMessage();
            // ------------------------------------------------------------------------------------------------------------------------------
            // Severe Name & Prot number
            // ------------------------------------------------------------------------------------------------------------------------------
            Client.Host = "EXCHANGE2k7";
            Client.Port = 25;

            // ------------------------------------------------------------------------------------------------------------------------------
            //if (EmailFrom != "")
            //{
            //    System.Net.Mail.MailAddress From = new System.Net.Mail.MailAddress(EmailFrom);
            //    Message.From = From;
            //}

            System.Net.Mail.MailAddress From = new System.Net.Mail.MailAddress("*****@*****.**");
            Message.From = From;
            // ------------------------------------------------------------------------------------------------------------------------------
            // Send message for To
            // ------------------------------------------------------------------------------------------------------------------------------
            var           SqlPass = "******" + autid + "' , '" + Session["EmpCode"] + "' ";
            SqlDataReader Dr      = obj.FetchReader(SqlPass);
            try
            {
                if (Dr.HasRows == true)
                {
                    Dr.Read();
                    {
                        if (Dr != null && Dr.HasRows)
                        {
                            EmailTO   = Dr["EmailID"].ToString();
                            name      = Dr["EmployeeName"].ToString();
                            empcodess = Dr["empcodess"].ToString();
                            //YYMonth = Dr["Yearmonth"].ToString();
                            //Message.CC.Add(ViewState["EmployeeFrom"].ToString());
                            //Message.CC.Add("*****@*****.**");
                            //Message.CC.Add("cc");
                            //Message.To.Add(EmailTO);

                            Message.Bcc.Add("*****@*****.**");
                            Message.Bcc.Add("*****@*****.**");
                        }
                    }
                    Dr.Close();
                }
            }
            catch (Exception ex)
            {
                string script = "alert('" + ex.Message + "');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "ServerControlScript", script, true);
            }
            finally
            {
                obj.ConClose();
            }
            Message.IsBodyHtml = true;
            Message.Priority   = System.Net.Mail.MailPriority.High;
            Message.Body       = "Dear User </br></br>" + name + "( " + " " + empcodess + " ) " + " " + " <br/><br/> Your " + " Reimbursement For The Month Of " + "  " + DrpLvStatus.SelectedItem.Value + " Has Been Authorized" + "<br/><br/> <br/><br/><br/><b>  </b>   <br/><br/><br/><br/><br/><br/> DISCLAIMER: This email is generated Payroll Employee Portal. <br/><br />Kindly do not reply . <br /> Thank You..!! ";
            Message.Subject    = "Reimbursement Authorization with ID " + autid.ToString();
            Message.To.Add(EmailTO.ToString());
            if (EmailTO != "")
            {
                Client.Send(Message);
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "hhh", "<script language = javascript>alert('Error Coming.')</script>");
        }

        finally
        {
        }
    }
コード例 #9
0
    protected void LogonBtn_Click(object sender, EventArgs e)
    {
        int count; count = 0;

        try
        {
            string str_connection = "Data Source = DESKTOP-DE1TOR3; Initial Catalog = VetClinic; Integrated Security = True";
            string sql            = "SELECT count([Email])FROM[VetClinic].[dbo].[Vet]" +
                                    " where[Email] = '" + TextBox1.Text + "' and [Password] = '" + TextBox2.Text + "' ;";

            using (var connection = new SqlConnection(str_connection))
                using (var Command = new SqlCommand(sql, connection))
                {
                    connection.Open();
                    using (var reader = Command.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            count = reader.GetInt32(0);
                        }
                    }
                }
        }
        catch (Exception ex)
        {
            string logonmessage          = "There was a problem with logging on - Contact Admin" + ex;
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script type = 'text/javascript'>");
            sb.Append("window.onload=function(){");
            sb.Append("alert('");
            sb.Append(logonmessage);
            sb.Append("')};");
            sb.Append("</script>");
            ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
        }

        {
            string message = "";
            if (count == 1)
            {
                message = "Login successful";
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("<script type = 'text/javascript'>");
                sb.Append("window.onload=function(){");
                sb.Append("alert('");
                sb.Append(message);
                sb.Append("')};");
                sb.Append("</script>");
                ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
                Session["VetMailId"] = TextBox1.Text;
                //checked to see if its the business owner
                if (TextBox1.Text == "*****@*****.**")
                {
                    Response.Redirect("OwnerPage.aspx");
                }
                else
                {
                    Response.Redirect("VetPage.aspx");
                }

                Response.Redirect("VetPage.aspx");
            }
            else
            {
                message = "Login Unsuccessful";
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("<script type = 'text/javascript'>");
                sb.Append("window.onload=function(){");
                sb.Append("alert('");
                sb.Append(message);
                sb.Append("')};");
                sb.Append("</script>");
                ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
            }
        }
    }
コード例 #10
0
        protected void btnConfirmar_Click(object sender, EventArgs e)
        {
            if (!FaltanDatos())
            {
                if (!VerificarCantidadAgregados())
                {
                    ClientScript.RegisterClientScriptBlock(GetType(), "alert", "alert('ERROR: El número de beneficiarios no coincide con el tipo de sesión.')", true);
                }
                else
                {
                    cSesion unaSesion = new cSesion();
                    switch (ddlTipoSesion.SelectedValue.ToString())
                    {
                    case "Individual":
                        unaSesion.TipoSesion = cUtilidades.TipoSesion.Individual;
                        break;

                    case "Grupo 2":
                        unaSesion.TipoSesion = cUtilidades.TipoSesion.Grupo2;
                        break;

                    case "Grupo 3":
                        unaSesion.TipoSesion = cUtilidades.TipoSesion.Grupo3;
                        break;

                    case "Taller":
                        unaSesion.TipoSesion = cUtilidades.TipoSesion.Taller;
                        break;

                    case "PROES":
                        unaSesion.TipoSesion = cUtilidades.TipoSesion.PROES;
                        break;
                    }
                    unaSesion.Fecha = txtFecha.Text;
                    if (RadioButtonList1.SelectedIndex == 0)
                    {
                        unaSesion.Centro = cUtilidades.Centro.JuanLacaze;
                    }
                    else
                    {
                        unaSesion.Centro = cUtilidades.Centro.NuevaHelvecia;
                    }

                    if (DateTime.Parse(ddlDesde.SelectedValue) >= DateTime.Parse(ddlHasta.SelectedValue))
                    {
                        ClientScript.RegisterClientScriptBlock(GetType(), "alert", "alert('ERROR: La hora de fin de la sesión debe ser mayor a la de inicio.')", true);
                    }
                    else
                    {
                        unaSesion.HoraInicio       = ddlDesde.SelectedValue;
                        unaSesion.HoraFin          = DateTime.Parse(ddlHasta.SelectedValue).AddMinutes(-1).ToShortTimeString();
                        unaSesion.lstBeneficiarios = new List <cBeneficiarioSesion>();
                        cBeneficiarioSesion unBen;
                        for (int i = 0; i < LosBeneficiariosAgregados.Count; i++)
                        {
                            unBen = new cBeneficiarioSesion();
                            unBen.Beneficiario = LosBeneficiariosAgregados[i]; switch (i)
                            {
                            case 0:
                                unBen.Plan = LosBeneficiariosAgregados[i].lstPlanes[ddlPlan1.SelectedIndex];
                                break;

                            case 1:
                                unBen.Plan = LosBeneficiariosAgregados[i].lstPlanes[ddlPlan2.SelectedIndex];
                                break;

                            case 2:
                                unBen.Plan = LosBeneficiariosAgregados[i].lstPlanes[ddlPlan3.SelectedIndex];
                                break;

                            case 3:
                                unBen.Plan = LosBeneficiariosAgregados[i].lstPlanes[ddlPlan4.SelectedIndex];
                                break;

                            case 4:
                                unBen.Plan = LosBeneficiariosAgregados[i].lstPlanes[ddlPlan5.SelectedIndex];
                                break;

                            case 5:
                                unBen.Plan = LosBeneficiariosAgregados[i].lstPlanes[ddlPlan6.SelectedIndex];
                                break;

                            case 6:
                                unBen.Plan = LosBeneficiariosAgregados[i].lstPlanes[ddlPlan7.SelectedIndex];
                                break;

                            case 7:
                                unBen.Plan = LosBeneficiariosAgregados[i].lstPlanes[ddlPlan8.SelectedIndex];
                                break;

                            default:
                                break;
                            }
                            unBen.Estado = cUtilidades.EstadoSesion.SinEstado;
                            unaSesion.lstBeneficiarios.Add(unBen);
                        }

                        unaSesion.lstUsuarios = LosEspecialistasAgregados;
                        List <cUsuario>      lstEspecialistasNoDisponibles = dFachada.SesionVerificarFechaYHorarioUsuario(unaSesion);
                        List <cBeneficiario> lstBeneficiariosNoDisponibles = dFachada.SesionVerificarFechaYHorarioBeneficiario(unaSesion);
                        string sEspecialistas = "";
                        string sBeneficiarios = "";

                        // ESPECIALISTAS NO DISPONIBLES
                        if (lstEspecialistasNoDisponibles.Count > 0)
                        {
                            if (lstEspecialistasNoDisponibles.Count > 1)
                            {
                                sEspecialistas += "Lo especialistas ";
                            }
                            for (int i = 0; i < lstEspecialistasNoDisponibles.Count; i++)
                            {
                                if (i == lstEspecialistasNoDisponibles.Count - 1)
                                {
                                    sEspecialistas += lstEspecialistasNoDisponibles[i].Nombres + " " + lstEspecialistasNoDisponibles[i].Apellidos;
                                }
                                else if (i == 0)
                                {
                                    sEspecialistas += lstEspecialistasNoDisponibles[i].Nombres + " " + lstEspecialistasNoDisponibles[i].Apellidos + ", ";
                                }
                                else if (i == lstEspecialistasNoDisponibles.Count - 2)
                                {
                                    sEspecialistas += lstEspecialistasNoDisponibles[i].Nombres + " " + lstEspecialistasNoDisponibles[i].Apellidos + " y ";
                                }
                            }
                            if (lstEspecialistasNoDisponibles.Count > 1)
                            {
                                sEspecialistas += " no están disponibles para la sesión.";
                            }
                            else
                            {
                                sEspecialistas += " no está disponible para la sesión.";
                            }
                        }
                        if (lstBeneficiariosNoDisponibles.Count > 0)
                        {
                            if (lstEspecialistasNoDisponibles.Count > 1)
                            {
                                sBeneficiarios += "Los beneficiarios ";
                            }
                            for (int i = 0; i < lstBeneficiariosNoDisponibles.Count; i++)
                            {
                                if (i == lstBeneficiariosNoDisponibles.Count - 1)
                                {
                                    sBeneficiarios += lstBeneficiariosNoDisponibles[i].Nombres + " " + lstBeneficiariosNoDisponibles[i].Apellidos;
                                }
                                else if (i == 0)
                                {
                                    sBeneficiarios += lstBeneficiariosNoDisponibles[i].Nombres + " " + lstBeneficiariosNoDisponibles[i].Apellidos + ", ";
                                }
                                else if (i == lstBeneficiariosNoDisponibles.Count - 2)
                                {
                                    sBeneficiarios += lstBeneficiariosNoDisponibles[i].Nombres + " " + lstBeneficiariosNoDisponibles[i].Apellidos + " y ";
                                }
                            }
                            if (lstBeneficiariosNoDisponibles.Count > 1)
                            {
                                sBeneficiarios += " no están disponibles para la sesión.";
                            }
                            else
                            {
                                sBeneficiarios += " no está disponible para la sesión.";
                            }
                        }
                        if (lstEspecialistasNoDisponibles.Count > 0 || lstBeneficiariosNoDisponibles.Count > 0)
                        {
                            ClientScript.RegisterClientScriptBlock(GetType(), "alert", string.Format("alert('ERROR: {0}{1} Su horario coincide con el de otra sesión.')", sEspecialistas, sBeneficiarios), true);
                        }
                        else
                        {
                            if (dFachada.SesionAgregar(unaSesion))
                            {
                                CargarTodo();
                                ClientScript.RegisterClientScriptBlock(GetType(), "alert", "alert('Se agregó la sesión correctamente.')", true);
                                string sScript = "window.opener.location.reload(); window.close();";
                                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "closewindows", sScript, true);
                            }
                            else
                            {
                                ClientScript.RegisterClientScriptBlock(GetType(), "alert", "alert('ERROR: No se pudo agregar la sesión.')", true);
                            }
                        }
                    }
                }
            }
            else
            {
                ClientScript.RegisterClientScriptBlock(GetType(), "alert", "alert('ERROR: Se requiere ingresar todos los datos de la sesión.')", true);
            }
        }
コード例 #11
0
        void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid)
                {
                    //将确认结果保存到数据库
                    using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString))
                    {
                        //生成回收物资设备入库单(合格)
                        SrinQualifiedReceipt sqrp = db.SrinQualifiedReceipt.SingleOrDefault(u => u.SrinQualifiedReceiptID.Equals(_receiptid));
                        sqrp.SrinQualifiedReceiptCode = txtCode.Text.Trim();
                        sqrp.NeedWriteOff             = chbWriteOff.Checked;
                        sqrp.Remark     = ((TextBox)GetControltByMaster("txtRemark")).Text.Trim();
                        sqrp.CreateTime = ((DateTimeControl)GetControltByMaster("dtcCreateTime")).SelectedDate;

                        //修改合格物资明细


                        bool bselected;                 //标识物资是否已经被选择过
                        int  iDetailsID, iPricingIndex; //物资ID,计量单位对应的索引:根台套件、米或吨
                        SrinAssetQualifiedDetails saqd;
                        decimal dQuantity = 0;
                        foreach (GridViewRow gvr in spgvMaterial.Rows)
                        {
                            iPricingIndex = GetPricingIndex(gvr.Cells[9].Text);
                            bselected     = Convert.ToBoolean(gvr.Cells[11].Text);
                            iDetailsID    = Convert.ToInt32(gvr.Cells[13].Text);

                            if (bselected)//修改原有物资的情况
                            {
                                saqd            = db.SrinAssetQualifiedDetails.SingleOrDefault(u => u.SrinAssetQualifiedDetailsID.Equals(iDetailsID));
                                dQuantity       = Convert.ToDecimal((gvr.Cells[iPricingIndex].Controls[0] as TextBox).Text.Trim());
                                saqd.Gentaojian = Convert.ToDecimal((gvr.Cells[2].Controls[0] as TextBox).Text.Trim());

                                if (saqd.Gentaojian == 0)//回收(跟台套件)数量为0的情况--则删除此项
                                {
                                    db.SrinAssetQualifiedDetails.DeleteOnSubmit(saqd);
                                }
                                else//不为0则修改此物资
                                {
                                    saqd.Metre       = Convert.ToDecimal((gvr.Cells[3].Controls[0] as TextBox).Text.Trim());
                                    saqd.Ton         = Convert.ToDecimal((gvr.Cells[4].Controls[0] as TextBox).Text.Trim());
                                    saqd.InUnitPrice = Convert.ToDecimal((gvr.Cells[6].Controls[0] as TextBox).Text.Trim());
                                    saqd.Remark      = ((TextBox)gvr.Cells[10].Controls[0]).Text.Trim();
                                    saqd.Amount      = dQuantity * saqd.OutUnitPrice;
                                    saqd.CreateTime  = db.ExecuteQuery <DateTime>("select  getdate()", new object[] { }).First();
                                }
                            }
                            else//加入新物资的情况
                            {
                                saqd            = new SrinAssetQualifiedDetails();
                                saqd.Gentaojian = Convert.ToDecimal((gvr.Cells[2].Controls[0] as TextBox).Text.Trim());
                                if (saqd.Gentaojian == 0)
                                {
                                    continue;
                                }

                                saqd.SrinQualifiedReceiptID       = sqrp.SrinQualifiedReceiptID;
                                saqd.SrinInspectorVerifyDetailsID = iDetailsID;

                                saqd.Metre         = Convert.ToDecimal((gvr.Cells[3].Controls[0] as TextBox).Text.Trim());
                                saqd.Ton           = Convert.ToDecimal((gvr.Cells[4].Controls[0] as TextBox).Text.Trim());
                                saqd.OutUnitPrice  = Convert.ToDecimal(gvr.Cells[5].Text);
                                saqd.InUnitPrice   = Convert.ToDecimal((gvr.Cells[6].Controls[0] as TextBox).Text.Trim());
                                saqd.CurUnit       = gvr.Cells[9].Text;
                                saqd.ManufactureID = Convert.ToInt32(gvr.Cells[12].Text);
                                saqd.Remark        = (gvr.Cells[10].Controls[0] as TextBox).Text.Trim();
                                saqd.Amount        = Convert.ToDecimal((gvr.Cells[iPricingIndex].Controls[0] as TextBox).Text.Trim()) * Convert.ToDecimal(gvr.Cells[5].Text);
                                saqd.CreateTime    = db.ExecuteQuery <DateTime>("select  getdate()", new object[] { }).First();
                                saqd.Creator       = db.EmpInfo.SingleOrDefault(u => u.Account == SPContext.Current.Web.CurrentUser.LoginName).EmpID;
                                db.SrinAssetQualifiedDetails.InsertOnSubmit(saqd);
                            }
                        }
                        db.SubmitChanges();

                        Response.Redirect(string.Format("RiAssetQualifiedReceiptMessage.aspx?TaskID={0}", _taskid), false);
                    }
                }
            }
            catch (Exception ex)
            {
                MethodBase    mb      = MethodBase.GetCurrentMethod();
                LogToDBHelper lhelper = LogToDBHelper.Instance;
                lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name));
                ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_INSERTERROR));
            }
        }
コード例 #12
0
        /// <summary>
        /// 데이터를 저장한다. (추가 or 수정)
        /// </summary>
        private void SaveData()
        {
            string img1 = CStringUtil.IsNullOrEmpty(upload_path_01.Value) == false?UploadFile(upload_01, "DIR_PROMOTION") : "";

            string img2 = CStringUtil.IsNullOrEmpty(upload_path_02.Value) == false?UploadFile(upload_02, "DIR_PROMOTION") : "";

            string img3 = CStringUtil.IsNullOrEmpty(upload_path_03.Value) == false?UploadFile(upload_03, "DIR_PROMOTION") : "";

            string img4 = CStringUtil.IsNullOrEmpty(upload_path_04.Value) == false?UploadFile(upload_04, "DIR_PROMOTION") : "";

            string img5 = CStringUtil.IsNullOrEmpty(upload_path_05.Value) == false?UploadFile(upload_05, "DIR_PROMOTION") : "";

            string menual = CStringUtil.IsNullOrEmpty(upload_path_file.Value) == false?UploadFile(upload_file, "DIR_PROMOTION") : "";

            string open_yn = (open_yn1.Checked) ? "Y" : "N";

            StringBuilder param = new StringBuilder();

            param.Append(LANG_CD);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(prod_cd.Value);
            string catgNo = catg_no.Value.Equals("") ? "0" : catg_no.Value;

            param.Append(CConst.DB_PARAM_DELIMITER).Append(catgNo);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(UPR_CATG_NO);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(catg_no2.SelectedValue);

            string db_new_yn = new_yn.Checked ? "Y" : "N";

            param.Append(CConst.DB_PARAM_DELIMITER).Append("PROD_ORG"); //제품유형
            param.Append(CConst.DB_PARAM_DELIMITER).Append(Session["admin_id"]);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img1);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img2);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img3);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img4);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img5);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(clip_url.Value);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(""); // 인체 의약품 카달로그 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append(menual);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(""); // 인체 의약품 썸네일 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append(prod_nm.Value);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(""); // 효능 - 인체 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append(ingredi.Value);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(temper.Value);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(pmedi.Value);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(hdnContent.Value.Replace("|", "&#124;"));
            param.Append(CConst.DB_PARAM_DELIMITER).Append(insu_cd.Value);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(pack_mea.Value);
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                 //주의사항 - 인체 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                 // 특장점 - 인체 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                 // 개요 - 인체 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                 // 보관 - 인체 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                 // 규격 - 인체 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                 // 비고 - 인체 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                 // 구성 - 인체 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                 // 정보 - 인체 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append(prod_div.Value);     // 구분
            param.Append(CConst.DB_PARAM_DELIMITER).Append(new_start_dt.Value); // 신제품 START
            param.Append(CConst.DB_PARAM_DELIMITER).Append(new_end_dt.Value);   // 신제품 END
            param.Append(CConst.DB_PARAM_DELIMITER).Append(open_yn);            // 노출여부
            param.Append(CConst.DB_PARAM_DELIMITER).Append(db_new_yn);          // 신제품 여부
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                 // 동의카테고리
            param.Append(CConst.DB_PARAM_DELIMITER).Append(reg_dt.Value);       // 등록일



            //System.Diagnostics.Debug.WriteLine("wwwwwwwww" + new_start_dt.Value);


            string[] result = null;

            if (CStringUtil.IsNullOrEmpty(ProdCd) == false)
            {
                // 수정 모드
                result = ExecuteQueryResult(3205, param.ToString());
            }
            else
            {
                // 입력 모드
                result = ExecuteQueryResult(3204, param.ToString());
            }

            if (result == null)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("시스템 오류가 발생 했습니다."));
            }
            else if (result[0].Equals("00") == false)
            {
                // 입력 or 수정 실패
                ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox(result[1]));
            }
            else
            {
                // 입력 성공 - 이어서 태그 입력
                AddTag();
            }
        }
コード例 #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region PAYTM RESPONSE
        String             paytm_trnid    = string.Empty;
        int                Result_OrderId = 0;
        AllPaymentResponse pay_resp       = new AllPaymentResponse();
        var                agentname      = "";
        try
        {
            agentname = Request.UserAgent.ToLower();
        }
        catch (Exception E)
        {
            agentname = "";
        }

        #region vaishnavi

        Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Information, "", 2, false, "1.PAYTM:SalebhaiPaymentResponsePaytm", " ");


        if (Request.Form.AllKeys.Length > 0)
        {
            try
            {
                Dictionary <string, string> parameterschk = new Dictionary <string, string>();
                StringBuilder sbresponse = new StringBuilder();
                foreach (string key in Request.Form.Keys)
                {
                    parameterschk.Add(key.Trim(), Request.Form[key].Trim());
                    sbresponse.Append(Request.Form[key].Trim() + " , ");
                }
                paytm_trnid = Request.Form["ORDERID"].ToString();

                Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Information, paytm_trnid, 2, false, "2.1.PAYTM:SalebhaiPaymentResponsePaytm GOT TRN ID", sbresponse.ToString());
                if (!String.IsNullOrEmpty(paytm_trnid))
                {
                    int resval = pay_resp.UpdateAndSaveTransactionBeforeOrderGenerated(2, paytm_trnid, sbresponse.ToString(), 2);

                    if (resval > 0)
                    {
                    }
                    else
                    {
                        Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Information, paytm_trnid, 2, false, "5.PAYTM:SalebhaiPaymentResponsePaytm: TRN NOT UPDATED " + Result_OrderId.ToString(), "Success");
                    }

                    try
                    {
                        Result_OrderId = pay_resp.PaymentResponsePaytm(parameterschk, sbresponse.ToString(), paytm_trnid);
                    }
                    catch (Exception err)
                    {
                        Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Error, paytm_trnid, 2, false, "3.PAYTM:ERROR  SalebhaiPaymentResponsePaytm IN ORDER GENERATION", "Error: " + err.Message.ToArray());
                        Result_OrderId = 0;
                    }
                    if (Result_OrderId > 0) // OrderId generated
                    {
                        Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Information, paytm_trnid, 2, false, "5.PAYTM:SalebhaiPaymentResponsePaytm: ORDER GENERATED Id: " + Result_OrderId.ToString(), "Success");
                        //pay_resp.RedirectToApp(Result_OrderId, paytm_trnid, 2,agentname);
                        string sb_val = pay_resp.RedirectToApp(Result_OrderId, paytm_trnid, 2, agentname);
                        if (!String.IsNullOrEmpty(sb_val))
                        {
                            Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Information, paytm_trnid, 2, false, "555.SalebhaiPaymentResponsePaytm: ORDER GENERATED APP SCRIPT: ", "Result_OrderId val =  " + Result_OrderId.ToString() + "Success : " + sb_val.ToString());


                            ClientScript.RegisterClientScriptBlock(this.GetType(), "Message", sb_val.ToString());
                        }
                    }
                    else
                    {
                        Result_OrderId = 0;
                        Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Error, paytm_trnid, 2, false, "5.PAYTM:SalebhaiPaymentResponsePaytm: ORDER NOT GENERATED Id: ", "Fail");
                    }
                }
                else
                {
                    Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Error, paytm_trnid, 2, false, "4.PAYTM:SalebhaiPaymentResponsePaytm", "NO TRANSACTION ID RESPONSE FOUND ");
                    Result_OrderId = 0;
                }
            }
            catch (Exception err)
            {
                Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Error, paytm_trnid, 2, false, "3.PAYTM:ERROR  SalebhaiPaymentResponsePaytm", "Error: " + err.Message.ToArray());

                Result_OrderId = 0;
            }
        }
        else
        {
            Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Error, paytm_trnid, 2, false, "4.PAYTM:SalebhaiPaymentResponsePaytm", "NO RESPONSE KEYS FOUND ");
            Result_OrderId = 0;
        }


        #endregion
        string sb_valn = pay_resp.RedirectToApp(Result_OrderId, paytm_trnid, 2, agentname);
        if (!String.IsNullOrEmpty(sb_valn))
        {
            Logger.InsertLogs(Test0555.Logger.InvoiceLOGS.InvoiceLogLevel.Information, paytm_trnid, 2, false, "555.SalebhaiPaymentResponsePaytm: ORDER GENERATED APP SCRIPT: ", "Result_OrderId val =  " + Result_OrderId.ToString() + "Success : " + sb_valn.ToString());


            ClientScript.RegisterClientScriptBlock(this.GetType(), "Message", sb_valn.ToString());
        }



        //ClientScript.RegisterClientScriptBlock(this.GetType(), "Message", sb_val.ToString());

        #endregion
    }
コード例 #14
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                var p = new Product();

                if (!ProductGuid.Equals(Guid.Empty))
                {
                    p = _repo.Single <Product>(ProductGuid);
                }

                if (!string.IsNullOrEmpty(tbCode.Text.Trim()))
                {
                    p.Code = tbCode.Text.Trim();
                }
                else
                {
                    throw new Exception("Product Code can't be empty");
                }

                p.Name        = tbName.Text.Trim();
                p.DisplayName = tbDisplayName.Text.Trim();
                p.ProductType = (ProductType)Enum.Parse(typeof(ProductType), ddlProductType.SelectedValue);
                p.ImageUrl    = tbImageUrl.Text.Trim();
                p.QrCodeUrl   = tbQrCodeUrl.Text.Trim();
                p.Material    = tbMaterial.Text.Trim();
                p.Colour      = tbColour.Text.Trim();

                if (!string.IsNullOrEmpty(ddlSize.SelectedValue))
                {
                    p.Size = (ProductSizeType)Enum.Parse(typeof(ProductSizeType), ddlSize.SelectedValue);
                }
                else
                {
                    p.Size = ProductSizeType.None;
                }

                p.Currency = (ProductCurrencyType)Enum.Parse(typeof(ProductCurrencyType), ddlCurrency.SelectedValue);
                p.Price    = Convert.ToSingle(tbPrice.Text.Trim());

                if (!string.IsNullOrEmpty(tbSale.Text.Trim()))
                {
                    p.Sale = Convert.ToSingle(tbSale.Text.Trim());
                }
                else
                {
                    p.Sale = null;
                }

                p.CreateTime  = DateTime.Now;
                p.Stock       = Convert.ToInt32(tbStock.Text.Trim());
                p.IsActive    = cbIsActive.Checked;
                p.Description = tbDescription.Text.Trim();
                p.Remark      = tbRemark.Text.Trim();

                if (ProductGuid != Guid.Empty)
                {
                    _repo.Update(p);

                    Product.Cache.RefreshCache();

                    ClientScript.RegisterClientScriptBlock(typeof(string), "succeed",
                                                           "alert('更新成功');window.location.href=window.location.href", true);
                }
                else
                {
                    if (_repo.All <Product>().Any(x => x.Code.ToLower().Equals(tbCode.Text.Trim().ToLower())))
                    {
                        throw new Exception("Product Code is already in use");
                    }

                    _repo.Insert(p);

                    Product.Cache.RefreshCache();

                    ClientScript.RegisterClientScriptBlock(typeof(string), "succeed",
                                                           "alert('添加成功');window.location.href = 'AdminProduct.aspx'", true);
                }
            }
            catch (Exception ex)
            {
                ClientScript.RegisterClientScriptBlock(typeof(string), "failed", $"alert('{ex.Message}')", true);
            }
        }
 public void Show_Message(string varErrorMessage)
 {
     ClientScript.RegisterClientScriptBlock(this.GetType(), "alter", "javascript:alert('" + varErrorMessage + "');", true);
     //lblError.Text = varErrorMessage;
 }
コード例 #16
0
        protected void BtnPostBack_Click(object sender, EventArgs e)
        {
            var strScript = @"<script> window alert('PostBack'); </script>";

            ClientScript.RegisterClientScriptBlock(this.GetType(), "postScript", strScript);
        }
コード例 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string Userid = Context.User.Identity.GetUserId();

            Session["Userid"] = Userid;
            PurchaseModel model        = new PurchaseModel();
            ProductModel  productmodel = new ProductModel();

            if (Userid != null)
            {
                if (!string.IsNullOrWhiteSpace(Request.QueryString["id"]))
                {
                    int id    = Convert.ToInt32(Request.QueryString["id"]);
                    int value = 1;
                    int quan  = 0;
                    if (!string.IsNullOrWhiteSpace(Request.QueryString["quan"]))
                    {
                        value = Convert.ToInt32(Request.QueryString["quan"]);
                    }

                    if (!string.IsNullOrWhiteSpace(Request.QueryString["quantity"]))
                    {
                        quan = Convert.ToInt32(Request.QueryString["quantity"]);
                    }

                    Purchase cart = new Purchase
                    {
                        Quantity  = value,
                        UsersID   = Userid,
                        DateTime  = Convert.ToString(DateTime.Now),
                        ProductID = id
                    };
                    int purchaseid        = model.check_order_product(Userid, id);
                    int purchasequantity  = model.check_order_quantity(Userid, id);
                    int purchaseproductid = model.check_order_productid(Userid, id);
                    available_quantity = productmodel.available_quantity_product(id);


                    //Session["avail_quantity"] = available_quantity;
                    if (value > available_quantity && available_quantity == 0 || quan > available_quantity && available_quantity == 0)
                    {
                        //MessageBox.Show("Sorry Product is Out of Stock");
                        string script = "alert('Sorry Product is Out of Stock');";
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script, true);

                        string site = String.Format("product_detail.aspx?id={0}", id);
                        Response.Redirect(site);
                    }

                    else if (purchaseid == 0)
                    {
                        model.insert_purchase(cart);
                    }

                    else if (quan != 0)
                    {
                        if (quan > available_quantity)
                        {
                            string script = "alert('Quantity selected is more than Available Quantity');";
                            ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script, true);
                        }
                        else
                        {
                            update_quantity(purchaseid, quan);
                        }
                    }

                    else if (purchasequantity == available_quantity)
                    {
                        string script = "alert('Product Quantity is already equal to Available Quantity');";
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script, true);
                    }
                    else
                    {
                        update_quantity(purchaseid, purchasequantity + 1);
                    }
                }
                else if (!string.IsNullOrWhiteSpace(Request.QueryString["del"]))
                {
                    int id = Convert.ToInt32(Request.QueryString["del"]);
                    model.delete_purchase(id);
                    Response.Redirect("cart.aspx");
                }


                //else if (!string.IsNullOrWhiteSpace(Request.QueryString["pur_id"]))
                //{
                //    int id = Convert.ToInt32(Request.QueryString["pur_id"]);
                //    int value = Convert.ToInt32(Request.QueryString["quan"]);
                //    string userId = Convert.ToString(HttpContext.Current.Session["Userid"]);
                //    if (value > available_quantity)
                //        {
                //            System.Windows.Forms.MessageBox.Show("Quantity selected is more than Available Quantity");
                //        }
                //        else
                //        {

                //        }

                //}
            }
            else
            {
                Response.Redirect("loginPage.aspx");
            }
        }
コード例 #18
0
 protected void lbOlvidaPassword_Click(object sender, EventArgs e)
 {
     ClientScript.RegisterClientScriptBlock(typeof(Page), "myscript", "alert('Eres un usuario muy descuidado! Haga memoria')", true);
 }
コード例 #19
0
 private void SubmitData(string token, string errorMessage = null)
 {
     ClientScript.RegisterClientScriptBlock(GetType(), "posttoparent",
                                            string.Format(CallbackJavascript, token, EncodeJsString(errorMessage)),
                                            true);
 }
コード例 #20
0
    protected void btSave_Click(object sender, EventArgs e)
    {
        System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");

        clsSecurity security = new clsSecurity();
        clsIO       IO       = new clsIO();

        string strDetailSub = string.Empty;
        string strDetail    = txtDetail.Text.Replace("<p>", "");

        strDetail = strDetail.Replace("</p>", "");
        string PicFull    = "null";
        string PicThumb   = "null";
        string pathPhoto  = "/Images/Event/";
        string pathImages = @"\Images\Event\";
        string outError;

        //upload Photo to server
        if (txtImgFull.HasFile)
        {
            //Full Images
            if (IO.UploadPhoto(txtImgFull, pathPhoto, "f_pic" + DateTime.Now.ToString("yyyyMMddHHmmss"), 5120, 0, 0, "", 0, out outError, out PicFull) == false)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Information", "alert('" + outError.ToString() + "')", true);
                return;
            }
            else
            {
                PicFull = pathImages + "" + PicFull;
            }
        }
        else
        {
            PicFull = lblImagesFull.Text.Trim();
        }
        if (txtImgThum.HasFile)
        {
            //Thumb Images
            if (IO.UploadPhoto(txtImgThum, pathPhoto, "t_pic" + DateTime.Now.ToString("yyyyMMddHHmmss"), 2048, 0, 0, "", 0, out outError, out PicThumb) == false)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Information", "alert('" + outError.ToString() + "')", true);
                return;
            }
            else
            {
                PicThumb = pathImages + "" + PicThumb;
            }
        }
        else
        {
            PicThumb = lblImagesThumb.Text.Trim();
        }

        //insert data to database
        try
        {
            if (txtDetail.Text.Length >= 200)
            {
                strDetailSub = "<p>" + strDetail.Substring(0, 200) + ".....</p>";
            }
            else
            {
                strDetailSub = "<p>" + strDetail + ".....</p>";
            }

            //Insert new Event
            if (string.IsNullOrEmpty(lblUID.Text) == true)
            {
                Event tbevent = new Event();

                //Assign values for insert into database
                tbevent.Subject         = txtSubject.Text.Trim();
                tbevent.Detail          = txtDetail.Text;
                tbevent.PicFull         = PicFull;
                tbevent.PicThumbnail    = PicThumb;
                tbevent.DepartmentUID   = 1;
                tbevent.ActiveDateFrom  = Convert.ToDateTime(txtDateFrom.Text);
                tbevent.ActiveDateTo    = Convert.ToDateTime(txtDateTo.Text);
                tbevent.Remark          = txtRemark.Text.Trim();
                tbevent.CWhen           = DateTime.Now;
                tbevent.CUser           = Convert.ToInt32(security.LoginUID);
                tbevent.MWhen           = DateTime.Now;
                tbevent.MUser           = Convert.ToInt32(security.LoginUID);
                tbevent.StatusFlag      = rdbActive.Checked == true ? "A" : "D";
                tbevent.LanguageUID     = Convert.ToInt32(ddlLanguage.SelectedValue);
                tbevent.DetailSub       = strDetailSub;
                tbevent.MetaKeywords    = txtMetaKeywords.Text.Trim();
                tbevent.MetaDescription = txtMetaDescription.Text.Trim();

                //Insert data of Event to database
                db.Events.InsertOnSubmit(tbevent);
            }
            else //Update existing Event
            {
                var tbEvent = from ev in db.Events
                              where ev.UID == Convert.ToInt32(lblUID.Text.Trim())
                              select ev;
                foreach (Event ev in tbEvent)
                {
                    ev.Subject         = txtSubject.Text.Trim();
                    ev.Detail          = txtDetail.Text;
                    ev.PicFull         = PicFull;
                    ev.PicThumbnail    = PicThumb;
                    ev.DepartmentUID   = 1;
                    ev.ActiveDateFrom  = Convert.ToDateTime(txtDateFrom.Text);
                    ev.ActiveDateTo    = Convert.ToDateTime(txtDateTo.Text);
                    ev.Remark          = txtRemark.Text.Trim();
                    ev.MWhen           = DateTime.Now;
                    ev.MUser           = Convert.ToInt32(security.LoginUID);
                    ev.StatusFlag      = rdbActive.Checked == true ? "A" : "D";
                    ev.MetaKeywords    = txtMetaKeywords.Text.Trim();
                    ev.MetaDescription = txtMetaDescription.Text.Trim();
                    try
                    {
                        ev.LanguageUID = Convert.ToInt32(ddlLanguage.SelectedValue);
                    }
                    catch (Exception ex)
                    {
                        ex.ToString();
                    }
                    ev.DetailSub = strDetailSub;
                }
            }
            db.SubmitChanges();
            clsColorBox clsColorBox = new clsColorBox();
            clsColorBox.Refresh();
            //Page.ClientScript.RegisterStartupScript(Page.GetType(), "closeWindow", "<script language='javascript'>parent.$.colorbox.close();</script>");
        }
        catch (Exception ex)
        {
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Information", "alert('" + ex.ToString() + "')", true);
        }
    }
コード例 #21
0
        protected void btnConfirmar_Click(object sender, EventArgs e)
        {
            // Verifica se algum arquivo foi selecionado
            if (!fluFoto.HasFile)
            {
                Glass.MensagemAlerta.ShowMsg("Nenhum arquivo selecionado.", Page);
                return;
            }

            if (txtSenhaCert.Text != txtConfSenha.Text)
            {
                Glass.MensagemAlerta.ShowMsg("A confirmação da senha está diferente da senha informada.", Page);
                return;
            }

            try
            {
                // Salva o arquivo do certificado
                string path = Data.Helper.Utils.GetCertPath + "loja" + Request["idLoja"] + ".pfx";

                // Se o arquivo já existir, apaga
                if (File.Exists(path))
                {
                    File.Delete(path);
                }

                fluFoto.SaveAs(path);
                ClientScript.RegisterClientScriptBlock(typeof(string), "reload", "alert('Certificado Digital cadastrado.'); closeWindow();", true);

                // Atualiza senha no cadastro de lojas
                LojaDAO.Instance.AtualizaSenhaCert(Glass.Conversoes.StrParaUint(Request["idLoja"]), txtSenhaCert.Text);


                //Recupera os dados do certificado para salvar a data de vencimento
                try
                {
                    X509Certificate2 cert = new X509Certificate2();
                    byte[]           rawData;

                    // Cria certificado
                    using (FileStream f = File.Open(path, FileMode.Open, FileAccess.Read))
                    {
                        f.Position = 0;
                        rawData    = new byte[f.Length];
                        f.Read(rawData, 0, rawData.Length);
                    }

                    cert.Import(rawData, LojaDAO.Instance.RecuperaSenhaCert(Glass.Conversoes.StrParaUint(Request["idLoja"])), X509KeyStorageFlags.MachineKeySet);

                    string dataVencimento = cert.NotAfter.ToString("dd/MM/yyyy");
                    LojaDAO.Instance.SalvaDataVencimento(Glass.Conversoes.StrParaUint(Request["idLoja"]), DateTime.Parse(dataVencimento));
                }
                catch (Exception ex)
                {
                    Glass.MensagemAlerta.ErrorMsg("Falha ao ler informações do certificado.", ex, Page);
                    return;
                }
            }
            catch (Exception ex)
            {
                Glass.MensagemAlerta.ErrorMsg("Falha ao cadastrar certificado.", ex, Page);
                return;
            }
        }
コード例 #22
0
ファイル: Default.aspx.cs プロジェクト: blendev/Trumans
        protected void btnPPCont_Click(object sender, EventArgs e)
        {
            try
            {
                var Surcharge   = Math.Round((Convert.ToDouble(amount.Value) * 3) / 100, 2);
                var orderAmount = (Convert.ToDouble(amount.Value) + Surcharge).ToString();

                Dictionary <string, string> PPPayment = new Dictionary <string, string>();
                PPPayment.Add("AccNum", accountNum.Value);
                // PPPayment.Add("Amount", amount.Value);

                PPPayment.Add("Amount", orderAmount);

                Session["PPPaymentDetails"] = PPPayment;
                CustomSecurityHeaderType _credentials = new CustomSecurityHeaderType
                {
                    Credentials = new UserIdPasswordType()
                    {
                        Username  = System.Configuration.ConfigurationManager.AppSettings["UserName"].ToString(),
                        Password  = System.Configuration.ConfigurationManager.AppSettings["Password"].ToString(),
                        Signature = System.Configuration.ConfigurationManager.AppSettings["Signature"].ToString(),
                    }
                };


                var expressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType();
                // expressCheckoutRequestDetails.ReturnURL = "http://payment.trumans.blendev.com/PayPalPayment.aspx";
                //expressCheckoutRequestDetails.CancelURL = "http://payment.trumans.blendev.com/PayPalCancel.aspx";
                expressCheckoutRequestDetails.CancelURL  = System.Configuration.ConfigurationManager.AppSettings["CancelURL"].ToString();
                expressCheckoutRequestDetails.ReturnURL  = System.Configuration.ConfigurationManager.AppSettings["SuccessURL"].ToString();
                expressCheckoutRequestDetails.NoShipping = "1";
                var paymentDetailsArray = new PaymentDetailsType[1];
                paymentDetailsArray[0] = new PaymentDetailsType
                {
                    PaymentAction = PaymentActionCodeType.Sale,
                    OrderTotal    = new BasicAmountType
                    {
                        currencyID = CurrencyCodeType.AUD,
                        Value      = orderAmount.ToString(),
                    }
                };

                BasicAmountType OTotal = new BasicAmountType();
                OTotal.Value      = orderAmount.ToString();
                OTotal.currencyID = CurrencyCodeType.AUD;
                expressCheckoutRequestDetails.OrderTotal = OTotal;

                var ExpressCheck = new SetExpressCheckoutRequestType
                {
                    SetExpressCheckoutRequestDetails = expressCheckoutRequestDetails,
                    Version = "98",
                };

                SetExpressCheckoutReq obj = new SetExpressCheckoutReq();
                obj.SetExpressCheckoutRequest = ExpressCheck;

                PayPalAPI.PayPalAPIAAInterfaceClient objPayPalAPI = new PayPalAPIAAInterfaceClient();

                var setExpressCheckoutResponse = objPayPalAPI.SetExpressCheckout(ref _credentials, obj);
                if (setExpressCheckoutResponse.Ack == AckCodeType.Success)
                {
                    Response.Redirect("https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=" + setExpressCheckoutResponse.Token, false);
                    Session["Token"] = setExpressCheckoutResponse.Token;
                }
                else
                {
                    StreamWriter File2 = File.AppendText(HttpContext.Current.Server.MapPath("~/Logs/file.txt"));
                    File2.WriteLine("Error : " + setExpressCheckoutResponse.Errors[0].LongMessage);
                    File2.Close();


                    string script = "<script type=\"text/javascript\">alert('Unexpected Error Occured , Please try Later!!');</script>";
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script);
                }
            }
            catch (Exception ex)
            {
                StreamWriter File2 = File.AppendText(HttpContext.Current.Server.MapPath("~/Logs/file.txt"));
                File2.WriteLine("Error : " + ex.Message);
                File2.Close();


                string script = "<script type=\"text/javascript\">alert('Unexpected Error Occured , Please try Later!!');</script>";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script);
            }
        }
コード例 #23
0
        protected void btnAddToTable_Click(object sender, EventArgs e)
        {
            herbName     = tbxHerb.Text.ToString();
            herbQuantity = Convert.ToDecimal(tbxQuantity.Text.ToString());

            string message;

            if (tbxHerb.Text != "" && tbxQuantity.Text != "")
            {
                //---Get ID of the herb
                string constr = ConfigurationManager.ConnectionStrings["conStr"].ConnectionString;

                using (SqlConnection con = new SqlConnection(constr))
                {
                    SqlCommand command = new SqlCommand("spGetHerbRefNum", con);
                    command.CommandType = System.Data.CommandType.StoredProcedure;

                    command.Parameters.AddWithValue("@herbName", herbName);
                    con.Open();
                    SqlDataReader rdr = command.ExecuteReader();
                    try
                    {
                        while (rdr.Read())
                        {
                            refNum = rdr["RefNum"].ToString();

                            if (refNum == "")
                            {
                                message = "No Herb: " + herbName + " in Herb Database! ";
                                ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true);
                                message = "";
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        message = "Error! " + ex;
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true);
                        message = "";
                    }
                    finally
                    {
                        con.Close();
                    }
                }
            }
            else
            {
                message = "No Herb selected! Please Enter requiered Herb.";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true);
                message = "";
            }
            phenixPrice  = GetHerbPrice(refNum, herbQuantity, "Phenix") * herbQuantity;
            balancePrice = GetHerbPrice(refNum, herbQuantity, "Balance") * herbQuantity;
            InsertRecordTempPrescription(refNum, herbName, herbQuantity, phenixPrice, balancePrice);
            GetTotals();

            GridView1.DataBind();
            GridView1.UseAccessibleHeader    = true;
            GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;
        }
コード例 #24
0
ファイル: ManagePage.cs プロジェクト: yidane/51wine
        /// <summary>
        /// 带确认按钮的提示
        /// </summary>
        /// <param name="msgtitle">提示文字</param>
        /// <param name="url">返回地址</param>
        /// <param name="msgcss">CSS样式</param>
        /// <param name="callback">JS回调函数</param>
        protected void JscriptConfirmMsg(string msgtitle, string url, string msgcss, string callback)
        {
            string msbox = "parent.jsconfirm(\"" + msgtitle + "\", \"" + url + "\", \"" + msgcss + "\", " + callback + ")";

            ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsConfirm", msbox, true);
        }
コード例 #25
0
        /// <summary>
        /// 데이터를 저장한다. (추가 or 수정)
        /// </summary>
        private void SaveData()
        {
            string img1 = CStringUtil.IsNullOrEmpty(upload_path_01.Value) == false?UploadFile(upload_01, "DIR_PROMOTION") : "";

            string img2 = CStringUtil.IsNullOrEmpty(upload_path_02.Value) == false?UploadFile(upload_02, "DIR_PROMOTION") : "";

            string img3 = CStringUtil.IsNullOrEmpty(upload_path_03.Value) == false?UploadFile(upload_03, "DIR_PROMOTION") : "";

            string img4 = CStringUtil.IsNullOrEmpty(upload_path_04.Value) == false?UploadFile(upload_04, "DIR_PROMOTION") : "";

            string img5 = CStringUtil.IsNullOrEmpty(upload_path_05.Value) == false?UploadFile(upload_05, "DIR_PROMOTION") : "";

            string menual = CStringUtil.IsNullOrEmpty(upload_path_file.Value) == false?UploadFile(upload_file, "DIR_PROMOTION") : "";

            string open_yn = (open_yn1.Checked) ? "Y" : "N";

            StringBuilder param = new StringBuilder();

            param.Append(LANG_CD);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(prod_cd.Value);
            string catgNo = catg_no.Value.Equals("") ? "0" : catg_no.Value;

            param.Append(CConst.DB_PARAM_DELIMITER).Append(catgNo);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(UPR_CATG_NO);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(catg_no2.SelectedValue); // 분류

            string db_new_yn = new_yn.Checked ? "Y" : "N";

            string prodType = string.Empty;

            prodType = pdt_org.Checked ? pdt_org.Value : prodType;
            //prodType = pdt_new.Checked ? pdt_new.Value : prodType;
            prodType = pdt_godl.Checked ? pdt_godl.Value : prodType;

            h_prod_img1_path.Value   = GetData(0, 0, "PROD_IMG1");
            h_prod_img2_path.Value   = GetData(0, 0, "PROD_IMG2");
            h_prod_img3_path.Value   = GetData(0, 0, "PROD_IMG3");
            h_prod_img4_path.Value   = GetData(0, 0, "PROD_IMG4");
            h_prod_img5_path.Value   = GetData(0, 0, "PROD_IMG5");
            h_prod_menual_path.Value = GetData(0, 0, "MANUAL");

            param.Append(CConst.DB_PARAM_DELIMITER).Append(prodType); // PROD_TYPE 입력못함
            param.Append(CConst.DB_PARAM_DELIMITER).Append(Session["admin_id"]);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img1);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img2);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img3);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img4);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(img5);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(clip_url.Value);                          // 동영상
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 카달로그 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append(menual);                                  // 설명서
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 썸네일 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append(prod_nm.Value);                           // 제품명
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // EFT가 뭔지 모르겠음
            param.Append(CConst.DB_PARAM_DELIMITER).Append(ingredi.Value);                           // 주요성분(성분함량)
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 성상 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append(pmedi.Value);                             // 약가
            param.Append(CConst.DB_PARAM_DELIMITER).Append(hdnContent.Value.Replace("|", "&#124;")); // 스마트 에디터
            param.Append(CConst.DB_PARAM_DELIMITER).Append(insu_cd.Value);                           // 보험코드
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 포장단위 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 주의사항
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 특장
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 개요 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 보관 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 규격 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 비고 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 구성 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 정보 - 동물 의약품 입력 안함
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 구분
            param.Append(CConst.DB_PARAM_DELIMITER).Append(new_start_dt.Value);                      // 신제품 START
            param.Append(CConst.DB_PARAM_DELIMITER).Append(new_end_dt.Value);                        // 신제품 END
            param.Append(CConst.DB_PARAM_DELIMITER).Append(open_yn);                                 // 노출여부
            param.Append(CConst.DB_PARAM_DELIMITER).Append(db_new_yn);                               // 신제품 여부
            param.Append(CConst.DB_PARAM_DELIMITER).Append("");                                      // 동의카테고리
            param.Append(CConst.DB_PARAM_DELIMITER).Append(reg_dt.Value);                            // 등록일

            string[] result = null;

            if (CStringUtil.IsNullOrEmpty(ProdCd) == false)
            {
                // 수정 모드
                result = ExecuteQueryResult(3205, param.ToString());
            }
            else
            {
                // 입력 모드
                result = ExecuteQueryResult(3204, param.ToString());
            }

            if (result == null)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("시스템 오류가 발생 했습니다."));
            }
            else if (result[0].Equals("00") == false)
            {
                // 입력 or 수정 실패
                ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox(result[1]));
            }
            else
            {
                // 입력 성공 - 이어서 태그 입력
                AddTag();
            }
        }
コード例 #26
0
 protected void Exit_Click(object sender, EventArgs e)
 {
     WebMsgBox.Show("Want to EXIT!......Press OK", this.Page);
     ClientScript.RegisterClientScriptBlock(this.GetType(), "ClosePopup", "window.close();window.opener.location.href=window.opener.location.href;", true);
     //  HttpContext.Current.Response.Redirect("FrmCancelEntryMain.aspx", true);
 }
コード例 #27
0
ファイル: Profile.aspx.cs プロジェクト: hfz-r/BudgetPrep
        protected void OnSubmittedFormSave(object sender, EventArgs e)
        {
            List <dynamic> ReturnObj = new List <dynamic>();

            try
            {
                Byte[] imgByte          = null;
                NameValueCollection nvc = Request.Form;

                MasterUser objMasterUser = new MasterUser();
                objMasterUser.UserName = nvc["ctl00$MainContent$username"];

                MembershipUser _User = Membership.GetUser(objMasterUser.UserName);
                if (_User == null)
                {
                    throw new Exception("Username " + HttpUtility.HtmlEncode(objMasterUser.UserName) + " not found. Please check the value and re-enter.");
                }
                else
                {
                    MasterUser _MasterUser = new UsersDAL().GetValidUser(_User.UserName);
                    if (_MasterUser.UUID == (Guid)_User.ProviderUserKey)
                    {
                        HttpPostedFile File = Request.Files["ctl00$MainContent$imgUpload"];
                        if (File != null && File.ContentLength > 0)
                        {
                            imgByte = new Byte[File.ContentLength];
                            File.InputStream.Read(imgByte, 0, File.ContentLength);

                            objMasterUser.Image = imgByte;
                        }
                        else
                        {
                            if (_MasterUser.Image != null)
                            {
                                objMasterUser.Image = _MasterUser.Image;
                            }
                        }

                        objMasterUser.UUID     = (Guid)_User.ProviderUserKey;
                        objMasterUser.FullName = (!string.IsNullOrEmpty(nvc["ctl00$MainContent$fullname"]) ? nvc["ctl00$MainContent$fullname"].Trim() : string.Empty);

                        string birthDate = (!string.IsNullOrEmpty(nvc["ctl00$MainContent$birthdate"]) ? nvc["ctl00$MainContent$birthdate"].Trim() : string.Empty);
                        if (birthDate != "")
                        {
                            objMasterUser.BirthDate = DateTime.ParseExact(birthDate, "dd-MM-yyyy", null);
                        }
                        else
                        {
                            objMasterUser.BirthDate = null;
                        }

                        if (!string.IsNullOrEmpty(nvc["ctl00$MainContent$Gender"]))
                        {
                            string selectedGender = nvc["ctl00$MainContent$Gender"].ToString();
                            objMasterUser.Gender = (selectedGender == "male" ? "M" : "F");
                        }

                        objMasterUser.Comment     = (!string.IsNullOrEmpty(nvc["ctl00$MainContent$comment"]) ? nvc["ctl00$MainContent$comment"].Trim() : string.Empty);
                        objMasterUser.Website     = (!string.IsNullOrEmpty(nvc["ctl00$MainContent$website"]) ? nvc["ctl00$MainContent$website"].Trim() : string.Empty);
                        objMasterUser.UserPhoneNo = nvc["ctl00$MainContent$phone"];

                        //email:new=update
                        if (_User.Email.Trim() != nvc["ctl00$MainContent$email"].Trim())
                        {
                            _User.Email = nvc["ctl00$MainContent$email"].Trim();
                            Membership.UpdateUser(_User);

                            objMasterUser.UserEmail = _User.Email;
                        }

                        //password:notnull=change()
                        if (!string.IsNullOrEmpty(nvc["ctl00$MainContent$oldpassword"]))
                        {
                            string oldpassword = string.Empty;
                            string newpassword = string.Empty;

                            oldpassword = nvc["ctl00$MainContent$oldpassword"].Trim();

                            if (!string.IsNullOrEmpty(nvc["ctl00$MainContent$newpassword"]) && !string.IsNullOrEmpty(nvc["ctl00$MainContent$confirmpassword"]))
                            {
                                newpassword = nvc["ctl00$MainContent$newpassword"].Trim();
                            }
                            else
                            {
                                throw new Exception("A password-related error has occured. Please try again.");
                            }

                            if (_User.ChangePassword(oldpassword, newpassword))
                            {
                                objMasterUser.UserPassword = newpassword;

                                bool mail = MailHelper.SendMail(new MasterUser()
                                {
                                    UserEmail = _User.Email,
                                    FullName  = objMasterUser.FullName,
                                    UserName  = objMasterUser.UserName
                                },
                                                                newpassword);

                                ReturnObj.Add(new
                                {
                                    source  = "Password Updated",
                                    message = "Password successfully updated. Your new password will be sent to your email id : "
                                              + new Helper().EmailClipper(_User.Email)
                                });
                            }
                            else
                            {
                                throw new Exception("A password-related error has occured. Please check your old password and Try Again!");
                            }
                        }

                        //sec. question/answer:notnull=change()
                        if ((_MasterUser.SecQuestion.Trim() != nvc["ctl00$MainContent$question"].Trim()) ||
                            (Security.Decrypt(_MasterUser.SecAnswer.Trim()) != nvc["ctl00$MainContent$answer"].Trim()))
                        {
                            string question = string.Empty;
                            string answer   = string.Empty;

                            if (!string.IsNullOrEmpty(nvc["ctl00$MainContent$question"]) && !string.IsNullOrEmpty(nvc["ctl00$MainContent$answer"]))
                            {
                                question = nvc["ctl00$MainContent$question"].Trim();
                                answer   = nvc["ctl00$MainContent$answer"].Trim();
                            }
                            else
                            {
                                throw new Exception("A security-related error has occured. Please try again.");
                            }

                            if (_User.ChangePasswordQuestionAndAnswer(_User.GetPassword(Security.Decrypt(_MasterUser.SecAnswer.Trim())), question, answer))
                            {
                                objMasterUser.SecQuestion = question;
                                objMasterUser.SecAnswer   = answer;

                                ReturnObj.Add(new
                                {
                                    source  = "Security Details Updated",
                                    message = "Security details (question/answer) successfully updated."
                                });
                            }
                        }

                        objMasterUser.ModifiedBy        = new UsersDAL().GetValidUser(HttpContext.Current.User.Identity.Name).UserID;
                        objMasterUser.ModifiedTimeStamp = DateTime.Now;

                        if (new UsersDAL().UpdateProfileUser(objMasterUser))
                        {
                            ReturnObj.Add(new
                            {
                                source  = "Profile Updated",
                                message = "Profile successfully updated."
                            });

                            string json   = JsonConvert.SerializeObject(ReturnObj, Formatting.Indented);
                            string script = "var data = " + json + ";";
                            ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "dataVar", script, true);

                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "output", "ShowOutput('" + _MasterUser.UserID + "');", true);
                        }
                        else
                        {
                            throw new Exception("An error occurred while updating user profile");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ((SiteMaster)this.Master).ShowMessage("Error", "An error occurred", ex, true);
            }
        }
コード例 #28
0
 protected void Reload()
 {
     ClientScript.RegisterClientScriptBlock(GetType(), "ClientScript",
                                            "<SCRIPT LANGUAGE='JavaScript'>parent.closeEditor(true);</SCRIPT>");
 }
コード例 #29
0
        /// <summary>
        /// 添加编辑删除提示
        /// </summary>
        /// <param name="msgtitle">提示文字</param>
        /// <param name="url">返回地址</param>
        protected void JscriptMsg(string msgtitle, string url)
        {
            string msbox = "parent.jsprint(\"" + msgtitle + "\", \"" + url + "\")";

            ClientScript.RegisterClientScriptBlock(Page.GetType(), "JsPrint", msbox, true);
        }
コード例 #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string SearchText = string.Empty;
            int departmentId = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["DepartmentId"]) && int.TryParse(Request.QueryString["DepartmentId"], out int n))
            {
                departmentId = Convert.ToInt32(Request.QueryString["DepartmentId"]);
            }
            //if (!string.IsNullOrEmpty(Request.QueryString["DocType"]))
            //    DocType.SelectedValue = Request.QueryString["DocType"];

            if (departmentId != 0 || !string.IsNullOrEmpty(Request.QueryString["DocType"]) || !string.IsNullOrEmpty(Request.QueryString["Search"]))
            {
                List <DocTypeSetModel> list = ISetService.GetSetsForMfilesAccount(departmentId, Request.QueryString["DocType"].ToString(), Request.QueryString["Search"].ToString(), 0, 0);
                if (list != null && list.Count != 0)
                {
                    StringBuilder asb   = new StringBuilder();
                    int           index = 1;
                    ExcelPackage  pck   = new ExcelPackage();

                    var ws = pck.Workbook.Worksheets.Add("Sample1");

                    ws.Cells["A" + index].Value = "S.No";
                    ws.Cells["B" + index].Value = "Branch";
                    ws.Cells["C" + index].Value = "Batch No";
                    ws.Cells["D" + index].Value = "Department";
                    ws.Cells["E" + index].Value = "Document Type";
                    ws.Cells["F" + index].Value = "AA NO/Project Code/Welfare Code";
                    ws.Cells["G" + index].Value = "Acount NO";
                    ws.Cells["H" + index].Value = "Total Pages";
                    ws.Cells["I" + index].Value = "Status";
                    ws.Cells["J" + index].Value = "User";
                    ws.Cells["K" + index].Value = "Created On";
                    ws.Cells["L" + index].Value = "Updated On";
                    index++;
                    int i = 1;
                    List <Department> departmentList = IDepartmentService.GetData(0, 0, false);
                    List <Branch>     branchList     = IBranchService.GetData(0, 0, false);
                    foreach (DocTypeSetModel set in list)
                    {
                        Department department = departmentList.FirstOrDefault(a => a.Id == set.DepartmentId);
                        ws.Cells["A" + index].Value = i;
                        ws.Cells["B" + index].Value = branchList.Count(a => a.Id == set.BatchId) != 0 ? branchList.FirstOrDefault(a => a.Id == set.BatchId).Code : "";
                        ws.Cells["C" + index].Value = set.BatchNo;
                        ws.Cells["D" + index].Value = departmentList.Count(a => a.Id == set.DepartmentId) != 0 ? departmentList.FirstOrDefault(a => a.Id == set.DepartmentId).Code : "";
                        ws.Cells["E" + index].Value = set.DocType;
                        ws.Cells["F" + index].Value = set.AANO;
                        ws.Cells["G" + index].Value = set.AccountNo;
                        ws.Cells["H" + index].Value = set.PageCount;
                        ws.Cells["I" + index].Value = MfileStatus(set.IsReleased);
                        ws.Cells["J" + index].Value = set.BatchUser;
                        ws.Cells["K" + index].Value = set.CreatedDate.ToString("dd/MM/yyyy HH:mm:ss");
                        ws.Cells["L" + index].Value = set.CreatedDate.ToString("dd/MM/yyyy HH:mm:ss");
                        i++;
                        index++;
                    }
                    pck.SaveAs(Response.OutputStream);
                    Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                    Response.AddHeader("content-disposition", "attachment;  filename=Sample1.xlsx");
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "Close", "window.close()", true);

                    Response.End();
                }
            }
        }