• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Models.FormContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Tingle_WebForms.Models.FormContext的典型用法代码示例。如果您正苦于以下问题:C# FormContext类的具体用法?C# FormContext怎么用?C# FormContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FormContext类属于Tingle_WebForms.Models命名空间,在下文中一共展示了FormContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetUserStatuses

        public IEnumerable<UserStatus> GetUserStatuses()
        {
            using (FormContext ctx = new FormContext())
            {
                var StatusList = ctx.UserStatuses.ToList();

                return StatusList;
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:9,代码来源:Site.Master.cs


示例2: FillEmailAddressLabels

        public void FillEmailAddressLabels()
        {
            List<String> listEmails = new List<String>();

            if (cbNotifyStandard.Checked)
            {
                using (FormContext ctx = new FormContext())
                {
                    if (ctx.InventoryNotificationEmailAddresses.Any(x => x.Status == 1))
                    {
                        ICollection<InventoryNotificationEmails> emailAddresses = ctx.InventoryNotificationEmailAddresses.Where(x => x.Status == 1).ToList();

                        if (emailAddresses.Count() > 0)
                        {
                            foreach (InventoryNotificationEmails email in emailAddresses)
                            {
                                listEmails.Add(email.Address);
                            }
                        }
                    }
                }
            }

            if (cbNotifyOther.Checked)
            {
                var notifyOtherList = ddlNotifyOther.CheckedItems;

                if (notifyOtherList.Any())
                {
                    foreach (var item in notifyOtherList)
                    {
                        if (item.Text != null)
                        {
                            listEmails.Add(item.Text);
                        }
                    }
                }

            }

            string emailList = "";

            foreach (string email in listEmails)
            {
                emailList += email + ", ";
            }

            if (emailList.Length >= 2)
            {
                if (emailList.Substring(emailList.Length - 2, 2) == ", ")
                {
                    emailList = emailList.Substring(0, emailList.Length - 2);
                }
            }

            lblEmailsSentTo.Text = emailList;
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:57,代码来源:InventoryApproval.aspx.cs


示例3: SendInventoryNotification

        public Boolean SendInventoryNotification(List<string> emailList, string bodyHtml, SystemUsers sentUser)
        {
            try
            {
                MailMessage completeMessage = new MailMessage();
                completeMessage.From = new MailAddress("[email protected]");
                completeMessage.Subject = "Inventory Approval Notification";
                completeMessage.Body = bodyHtml;
                completeMessage.IsBodyHtml = true;

                //SmtpClient client = new SmtpClient("TingleNT30.wctingle.com");
                //client.UseDefaultCredentials = true;
                SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
                client.Credentials = new NetworkCredential("[email protected]", "ZXCasdQWE123!");
                client.EnableSsl = true;

                using (FormContext ctx = new FormContext())
                {
                    foreach (string email in emailList)
                    {
                        InventoryApprovalNotifications newRN = new InventoryApprovalNotifications
                        {
                            BodyHtml = bodyHtml,
                            SentBy = ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == sentUser.SystemUserID),
                            Status = 0,
                            Timestamp = DateTime.Now,
                            ToEmailAddress = email
                        };

                        ctx.InventoryApprovalNotifications.Add(newRN);
                        ctx.SaveChanges();

                        try
                        {
                            completeMessage.To.Clear();
                            completeMessage.To.Add(email);
                            client.Send(completeMessage);

                            newRN.Status = 1;

                            ctx.SaveChanges();
                        }
                        catch (Exception exc)
                        { }

                    }
                }

                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:55,代码来源:SendEmail.cs


示例4: Application_Start

 void Application_Start(object sender, EventArgs e)
 {
     // Code that runs on application startup
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     AuthConfig.RegisterOpenAuth();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     Database.SetInitializer(new MigrateDatabaseToLatestVersion<FormContext, Configuration>());
     using (FormContext temp = new FormContext())
     {
         temp.Database.Initialize(true);
     }
 }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:12,代码来源:Global.asax.cs


示例5: HasBeenAssigned

 public bool HasBeenAssigned(SystemUsers user, Int32 formId, string formName)
 {
     try
     {
         using (FormContext context = new FormContext())
         {
             return context.UserAssignments.Any(x => x.User.SystemUserID == user.SystemUserID && x.RelatedFormId == formId && x.Form.FormName == formName);
         }
     }
     catch (Exception ex)
     {
         return false;
     }
 }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:14,代码来源:UserLogic.cs


示例6: HasAccess

 public bool HasAccess(SystemUsers user, string formName)
 {
     try
     {
         using (FormContext ctx = new FormContext())
         {
             return ctx.FormPermissions.Any(x => x.Enabled == true && x.FormName == formName && x.UserRole.UserRoleId == user.UserRole.UserRoleId);
         }
     }
     catch (Exception ex)
     {
         return false;
     }
 }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:14,代码来源:UserLogic.cs


示例7: AddExpeditedOrderForm

        public bool AddExpeditedOrderForm(string oowOrderNumber, string customer, string accountNumber, ExpediteCode expediteCode, string purchaseOrderNumber, string materialSku, string quantityOrdered,
            Nullable<DateTime> installDate, string sM, string contactName, string phoneNumber, string shipToName, string shipToAddress, string shipToCity, string shipToState, string shipToZip,
            string additionalInfo, Status status, string submittedByUser, string ccFormToEmail, string company, out Int32 formId)
        {
            try
            {
                using (FormContext _db = new FormContext())
                {
                    var expCode = _db.ExpediteCodes.SingleOrDefault(ec => ec.ExpediteCodeID == expediteCode.ExpediteCodeID);
                    var submissionStatus = _db.Statuses.SingleOrDefault(s => s.StatusId == status.StatusId);

                    var newForm = new ExpeditedOrderForm();
                    newForm.Timestamp = DateTime.Now;
                    newForm.OowOrderNumber = oowOrderNumber;
                    newForm.Customer = customer;
                    newForm.AccountNumber = accountNumber;
                    newForm.ExpediteCode = expCode;
                    newForm.PurchaseOrderNumber = purchaseOrderNumber;
                    newForm.InstallDate = installDate;
                    newForm.SM = sM;
                    newForm.ContactName = contactName;
                    newForm.PhoneNumber = phoneNumber;
                    newForm.ShipToName = shipToName;
                    newForm.ShipToAddress = shipToAddress;
                    newForm.ShipToCity = shipToCity;
                    newForm.ShipToState = shipToState;
                    newForm.ShipToZip = shipToZip;
                    newForm.AdditionalInfo = additionalInfo;
                    newForm.Status = submissionStatus;
                    newForm.SubmittedByUser = submittedByUser;
                    newForm.CCFormToEmail = ccFormToEmail;
                    newForm.Company = company;

                    _db.ExpeditedOrderForms.Add(newForm);
                    _db.SaveChanges();

                    formId = newForm.RecordId;
                }
                return true;
            }
            catch (Exception ex)
            {
                formId = 0;
                return false;
                //throw ex;

            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:48,代码来源:AddExpeditedOrderForm.cs


示例8: fvEmailInsert_InsertItem

        public void fvEmailInsert_InsertItem()
        {
            try
            {
                TextBox txtNameInsert = (TextBox)fvEmailInsert.FindControl("txtNameInsert");
                TextBox txtAddressInsert = (TextBox)fvEmailInsert.FindControl("txtAddressInsert");
                RadioButtonList rblCompanyInsert = (RadioButtonList)fvEmailInsert.FindControl("rblCompanyInsert");
                RadioButtonList rblStatusInsert = (RadioButtonList)fvEmailInsert.FindControl("rblStatusInsert");
                Int16 status = Convert.ToInt16(rblStatusInsert.SelectedValue);
                int id = Convert.ToInt32(ddlFormName.SelectedValue);

                using (FormContext ctx = new FormContext())
                {
                    var tForm = ctx.TForms.Where(f => f.FormID == id).FirstOrDefault();

                    EmailAddress newEmail = new EmailAddress();

                    newEmail.Name = txtNameInsert.Text;
                    newEmail.Address = txtAddressInsert.Text;
                    newEmail.Company = rblCompanyInsert.SelectedValue;
                    newEmail.Status = status;
                    newEmail.TForm = tForm;
                    newEmail.Timestamp = DateTime.Now;

                    ctx.EmailAddresses.Add(newEmail);

                    if (ModelState.IsValid)
                    {
                        ctx.SaveChanges();
                        gvEmailList.DataBind();
                    }

                    lblEmailMessage.Text = "";
                }
            }
            catch (Exception ex)
            {
                lblEmailMessage.Text = "Unable to insert new Email Address.  Please contact your system administrator.";
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:40,代码来源:Administration.aspx.cs


示例9: btnSubmit_Click

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid)
                {
                    Int32 formId;
                    int statusId;
                    DateTime tryDueDate;
                    Nullable<DateTime> dueDate = null;
                    string emailListString = lblEmailsSentTo.Text.Replace(" ", "");
                    List<string> emailList = emailListString.Split(',').ToList<string>();

                    System.Security.Principal.IPrincipal user = System.Web.HttpContext.Current.User;
                    UserLogic uLogic = new UserLogic();
                    SystemUsers currentUser = uLogic.GetCurrentUser(user);

                    statusId = Convert.ToInt32(ddlStatus.SelectedValue);

                    if (txtDueByDate.Value != "")
                    {
                        DateTime.TryParse(txtDueByDate.Value, out tryDueDate);

                        if (tryDueDate.Year > 0001)
                        {
                            dueDate = tryDueDate;
                        }
                    }
                    else
                    {
                        dueDate = null;
                    }

                    using (FormContext ctx = new FormContext())
                    {
                        var status = ctx.Statuses.Where(s => s.StatusId.Equals(statusId)).FirstOrDefault();
                        Int32 requestedUserId = Convert.ToInt32(ddlRequestedBy.SelectedValue);
                        var requestedUser = ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == requestedUserId);
                        var modifiedUser = ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == currentUser.SystemUserID);

                        Models.LowInventoryForm newForm = new Models.LowInventoryForm
                        {
                            Timestamp = DateTime.Now,
                            Company = ddlCompany.SelectedValue,
                            OrderNumber = txtOrderNumber.Text,
                            Plant = ctx.Plants.FirstOrDefault(x => x.PlantText == ddlPlants.SelectedText),
                            Line = txtLine.Text,
                            Quantity = txtQuantity.Text,
                            SKU = txtSKU.Text,
                            Status = ctx.Statuses.FirstOrDefault(s => s.StatusText == ddlStatus.SelectedItem.Text),
                            RequestedUser = requestedUser,
                            LastModifiedUser = modifiedUser,
                            SubmittedUser = ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == currentUser.SystemUserID),
                            DueDate = dueDate,
                            Priority = ctx.Priorities.FirstOrDefault(x => x.PriorityText == ddlPriority.SelectedText),
                            LastModifiedTimestamp = DateTime.Now
                        };

                        if (ddlAssignedTo.SelectedIndex != -1)
                        {
                            Int32 assignedUserId = Convert.ToInt32(ddlAssignedTo.SelectedValue);
                            newForm.AssignedUser = ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == assignedUserId);
                        }

                        ctx.LowInventoryForms.Add(newForm);
                        ctx.SaveChanges();

                        if (newForm.AssignedUser != null)
                        {
                            Int32 assignedUserId = Convert.ToInt32(ddlAssignedTo.SelectedValue);

                            UserAssignmentAssociation uA = new UserAssignmentAssociation
                            {
                                Form = ctx.TForms.FirstOrDefault(x => x.FormName == "Low Inventory"),
                                RelatedFormId = newForm.RecordId,
                                User = ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == assignedUserId)
                            };

                            ctx.UserAssignments.Add(uA);
                        }

                        if (newForm.RequestedUser != null)
                        {
                            UserRequestAssociation uR = new UserRequestAssociation
                            {
                                Form = ctx.TForms.FirstOrDefault(x => x.FormName == "Low Inventory"),
                                RelatedFormId = newForm.RecordId,
                                User = requestedUser
                            };

                            ctx.UserRequests.Add(uR);
                        }

                        ctx.SaveChanges();

                        formId = newForm.RecordId;

                        Comments systemComment = new Comments
                        {
                            Form = ctx.TForms.FirstOrDefault(x => x.FormName == "Low Inventory"),
//.........这里部分代码省略.........
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:101,代码来源:LowInventoryForm.aspx.cs


示例10: GetPOStatuses

        public IEnumerable<PurchaseOrderStatus> GetPOStatuses()
        {
            using (FormContext ctx = new FormContext())
            {
                var StatusList = ctx.POStatuses.ToList();

                return StatusList;
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:9,代码来源:OrderCancellationForm.aspx.cs


示例11: FillEmailAddressLabels

        public void FillEmailAddressLabels()
        {
            lblNotifyAssigneeValue.Text = ddlAssignedTo.SelectedIndex != -1 ? ddlAssignedTo.SelectedItem.Text : "";
            lblNotifyRequesterValue.Text = ddlRequestedBy.SelectedIndex != -1 ? ddlRequestedBy.SelectedItem.Text : "";
            lblNotifyStandardValue.Text = ddlCompany.SelectedText;

            List<String> listEmails = new List<String>();

            if (cbNotifyStandard.Checked)
            {
                using (FormContext ctx = new FormContext())
                {
                    if (ctx.EmailAddresses.Any(x => x.Status == 1 && x.TForm.FormName == "Low Inventory" && x.Company == ddlCompany.SelectedText))
                    {
                        ICollection<EmailAddress> emailAddresses = ctx.EmailAddresses.Where(x => x.Status == 1 && x.TForm.FormName == "Low Inventory" && x.Company == ddlCompany.SelectedText).ToList();

                        if (emailAddresses.Count() > 0)
                        {
                            foreach (EmailAddress email in emailAddresses)
                            {
                                listEmails.Add(email.Address);
                            }
                        }
                    }
                }
            }

            if (cbNotifyAssignee.Checked)
            {
                if (lblNotifyAssigneeValue.Text != "")
                {
                    listEmails.Add(lblNotifyAssigneeValue.Text);
                }
            }

            if (cbNotifyRequester.Checked)
            {
                if (lblNotifyRequesterValue.Text != "")
                {
                    listEmails.Add(lblNotifyRequesterValue.Text);
                }
            }

            if (cbNotifyOther.Checked)
            {
                var notifyOtherList = ddlNotifyOther.CheckedItems;

                if (notifyOtherList.Any())
                {
                    foreach (var item in notifyOtherList)
                    {
                        if (item.Text != null)
                        {
                            listEmails.Add(item.Text);
                        }
                    }
                }

            }

            string emailList = "";

            foreach (string email in listEmails)
            {
                emailList += email + ", ";
            }

            if (emailList.Length >= 2)
            {
                if (emailList.Substring(emailList.Length - 2, 2) == ", ")
                {
                    emailList = emailList.Substring(0, emailList.Length - 2);
                }
            }

            lblEmailsSentTo.Text = emailList;
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:77,代码来源:LowInventoryForm.aspx.cs


示例12: btnAddComment_Click

        protected void btnAddComment_Click(object sender, EventArgs e)
        {
            try
            {
                Label lblRecordId = (Label)fvReport.FindControl("lblRecordId");
                int recordId;
                Int32.TryParse(lblRecordId.Text, out recordId);
                RadTextBox txtNewComment = (RadTextBox)fvReport.FindControl("txtNewComment");
                Repeater rptrComments = (Repeater)fvReport.FindControl("rptrComments");

                UserLogic newLogic = new UserLogic();

                System.Security.Principal.IPrincipal user = System.Web.HttpContext.Current.User;
                SystemUsers currentUser = newLogic.GetCurrentUser(user);

                using (var ctx = new FormContext())
                {
                    var thisForm = ctx.MustIncludeForms.FirstOrDefault(eof => eof.RecordId == recordId);

                    Comments newComment = new Comments
                    {
                        Form = ctx.TForms.FirstOrDefault(x => x.FormName == "Must Include"),
                        Note = txtNewComment.Text,
                        RelatedFormId = thisForm.RecordId,
                        SystemComment = false,
                        Timestamp = DateTime.Now,
                        User = ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == currentUser.SystemUserID)
                    };

                    ctx.Comments.Add(newComment);
                    ctx.SaveChanges();

                    txtNewComment.Text = "";
                    txtNewComment.Invalid = false;

                    rptrComments.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:43,代码来源:ReportMustInclude.aspx.cs


示例13: ddlCompanyEdit_DataBinding

        protected void ddlCompanyEdit_DataBinding(object sender, EventArgs e)
        {
            try
            {
                RadDropDownList ddlCompanyEdit = (RadDropDownList)sender;
                Label lblRecordId = (Label)fvReport.FindControl("lblRecordId");
                int recordId;
                Int32.TryParse(lblRecordId.Text, out recordId);

                using (var ctx = new FormContext())
                {
                    var thisForm = ctx.MustIncludeForms.FirstOrDefault(eof => eof.RecordId == recordId);

                    ddlCompanyEdit.SelectedValue = thisForm.Company;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:21,代码来源:ReportMustInclude.aspx.cs


示例14: GetWarehouses

        public IEnumerable<Warehouse> GetWarehouses()
        {
            using (FormContext ctx = new FormContext())
            {
                var whList = ctx.Warehouses.ToList();

                return whList;
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:9,代码来源:ReportMustInclude.aspx.cs


示例15: FillEmailAddressLabels

        public void FillEmailAddressLabels()
        {
            Label lblNotifyAssigneeValue = (Label)fvReport.FindControl("lblNotifyAssigneeValue");
            Label lblNotifyRequesterValue = (Label)fvReport.FindControl("lblNotifyRequesterValue");
            Label lblNotifyStandardValue = (Label)fvReport.FindControl("lblNotifyStandardValue");
            Label lblEmailsSentTo = (Label)fvReport.FindControl("lblEmailsSentTo");
            RadComboBox ddlAssignedToEdit = (RadComboBox)fvReport.FindControl("ddlAssignedToEdit");
            RadComboBox ddlRequestedByEdit = (RadComboBox)fvReport.FindControl("ddlRequestedByEdit");
            RadDropDownList ddlCompanyEdit = (RadDropDownList)fvReport.FindControl("ddlCompanyEdit");
            RadComboBox ddlNotifyOther = (RadComboBox)fvReport.FindControl("ddlNotifyOther");
            CheckBox cbNotifyStandard = (CheckBox)fvReport.FindControl("cbNotifyStandard");
            CheckBox cbNotifyAssignee = (CheckBox)fvReport.FindControl("cbNotifyAssignee");
            CheckBox cbNotifyRequester = (CheckBox)fvReport.FindControl("cbNotifyRequester");
            CheckBox cbNotifyOther = (CheckBox)fvReport.FindControl("cbNotifyOther");

            lblNotifyAssigneeValue.Text = ddlAssignedToEdit.SelectedIndex != -1 ? ddlAssignedToEdit.SelectedItem.Text : "";
            lblNotifyRequesterValue.Text = ddlRequestedByEdit.SelectedIndex != -1 ? ddlRequestedByEdit.SelectedItem.Text : "";
            lblNotifyStandardValue.Text = ddlCompanyEdit.SelectedText;

            List<String> listEmails = new List<String>();

            if (cbNotifyStandard.Checked)
            {
                using (FormContext ctx = new FormContext())
                {
                    if (ctx.EmailAddresses.Any(x => x.Status == 1 && x.TForm.FormName == "Must Include" && x.Company == ddlCompanyEdit.SelectedText))
                    {
                        ICollection<EmailAddress> emailAddresses = ctx.EmailAddresses.Where(x => x.Status == 1 && x.TForm.FormName == "Must Include" && x.Company == ddlCompanyEdit.SelectedText).ToList();

                        if (emailAddresses.Count() > 0)
                        {
                            foreach (EmailAddress email in emailAddresses)
                            {
                                listEmails.Add(email.Address);
                            }
                        }
                    }
                }
            }

            if (cbNotifyAssignee.Checked)
            {
                if (lblNotifyAssigneeValue.Text != "")
                {
                    listEmails.Add(lblNotifyAssigneeValue.Text);
                }
            }

            if (cbNotifyRequester.Checked)
            {
                if (lblNotifyRequesterValue.Text != "")
                {
                    listEmails.Add(lblNotifyRequesterValue.Text);
                }
            }

            if (cbNotifyOther.Checked)
            {
                var notifyOtherList = ddlNotifyOther.CheckedItems;

                if (notifyOtherList.Any())
                {
                    foreach (var item in notifyOtherList)
                    {
                        if (item.Text != null)
                        {
                            listEmails.Add(item.Text);
                        }
                    }
                }

            }

            string emailList = "";

            foreach (string email in listEmails)
            {
                emailList += email + ", ";
            }

            if (emailList.Length >= 2)
            {
                if (emailList.Substring(emailList.Length - 2, 2) == ", ")
                {
                    emailList = emailList.Substring(0, emailList.Length - 2);
                }
            }

            lblEmailsSentTo.Text = emailList;
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:90,代码来源:ReportMustInclude.aspx.cs


示例16: GetOtherEmails

        public IEnumerable<NotifyOtherList> GetOtherEmails()
        {
            try
            {
                using (FormContext ctx = new FormContext())
                {
                    var userList = from s in ctx.SystemUsers
                                   select new NotifyOtherList { Address = s.EmailAddress, Name = s.DisplayName };

                    var otherList = from n in ctx.NotificationEmailAddresses
                                    select new NotifyOtherList { Address = n.Address, Name = n.Name };

                    return userList.Union(otherList).ToList().OrderBy(x => x.Name);

                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:21,代码来源:ReportMustInclude.aspx.cs


示例17: fvReport_PreRender

        protected void fvReport_PreRender(object sender, EventArgs e)
        {
            Button btnUpdate = (Button)fvReport.FindControl("btnUpdate");
            Button btnCancel = (Button)fvReport.FindControl("btnCancel");
            Button btnBack = (Button)fvReport.FindControl("btnDetailsBack");

            System.Security.Principal.IPrincipal user = System.Web.HttpContext.Current.User;
            UserLogic uLogic = new UserLogic();
            SystemUsers currentUser = uLogic.GetCurrentUser(user);

            RadDropDownList ddlCompanyEdit = (RadDropDownList)fvReport.FindControl("ddlCompanyEdit");
            Label lblCompanyEdit = (Label)fvReport.FindControl("lblCompanyEdit");
            TextBox txtPOEdit = (TextBox)fvReport.FindControl("txtPOEdit");
            TextBox txtArmstrongReferenceEdit = (TextBox)fvReport.FindControl("txtArmstrongReferenceEdit");
            TextBox txtPatternEdit = (TextBox)fvReport.FindControl("txtPatternEdit");
            TextBox txtLineEdit = (TextBox)fvReport.FindControl("txtLineEdit");
            TextBox txtOrderNumberEdit = (TextBox)fvReport.FindControl("txtOrderNumberEdit");
            TextBox txtCustomerEdit = (TextBox)fvReport.FindControl("txtCustomerEdit");
            TextBox txtWarehouseEdit = (TextBox)fvReport.FindControl("txtWarehouseEdit");
            RadDropDownList ddlStatusEdit = (RadDropDownList)fvReport.FindControl("ddlStatusEdit");
            RadComboBox ddlRequestedByEdit = (RadComboBox)fvReport.FindControl("ddlRequestedByEdit");
            RadComboBox ddlAssignedToEdit = (RadComboBox)fvReport.FindControl("ddlAssignedToEdit");
            RadDropDownList ddlPriorityEdit = (RadDropDownList)fvReport.FindControl("ddlPriorityEdit");
            HtmlInputText txtDueByDateEdit = (HtmlInputText)fvReport.FindControl("txtDueByDateEdit");
            CheckBox cbNotifyStandard = (CheckBox)fvReport.FindControl("cbNotifyStandard");
            CheckBox cbNotifyAssignee = (CheckBox)fvReport.FindControl("cbNotifyAssignee");
            CheckBox cbSendComments = (CheckBox)fvReport.FindControl("cbSendComments");
            CheckBox cbNotifyOther = (CheckBox)fvReport.FindControl("cbNotifyOther");
            CheckBox cbNotifyRequester = (CheckBox)fvReport.FindControl("cbNotifyRequester");
            RadComboBox ddlNotifyOther = (RadComboBox)fvReport.FindControl("ddlNotifyOther");
            RadButton btnAddNewEmail = (RadButton)fvReport.FindControl("btnAddNewEmail");
            Button btnAddComment = (Button)fvReport.FindControl("btnAddComment");

            FillEmailAddressLabels();

            Label lblRecordId = (Label)fvReport.FindControl("lblRecordId");
            int recordId;
            Int32.TryParse(lblRecordId.Text, out recordId);
            Boolean isComplete;

            using (var ctx = new FormContext())
            {
                var thisForm = ctx.MustIncludeForms.FirstOrDefault(eof => eof.RecordId == recordId);

                isComplete = thisForm.Status.StatusText == "Completed" ? true : false;
            }

            if (currentUser.UserRole.RoleName == "ReportsUser" && isComplete)
            {
                ddlCompanyEdit.Enabled = false;
                txtPOEdit.Enabled = false;
                txtArmstrongReferenceEdit.Enabled = false;
                txtPatternEdit.Enabled = false;
                txtLineEdit.Enabled = false;
                txtOrderNumberEdit.Enabled = false;
                txtCustomerEdit.Enabled = false;
                txtWarehouseEdit.Enabled = false;
                ddlStatusEdit.Enabled = false;
                ddlRequestedByEdit.Enabled = false;
                ddlAssignedToEdit.Enabled = false;
                ddlPriorityEdit.Enabled = false;
                txtDueByDateEdit.Disabled = true;
                cbNotifyStandard.Enabled = false;
                cbNotifyAssignee.Enabled = false;
                cbSendComments.Enabled = false;
                cbNotifyOther.Enabled = false;
                cbNotifyRequester.Enabled = false;
                ddlNotifyOther.Enabled = false;
                btnAddNewEmail.Enabled = false;
                btnAddComment.Enabled = false;
                btnUpdate.Enabled = false;
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:73,代码来源:ReportMustInclude.aspx.cs


示例18: GetStatuses

        public IEnumerable<Status> GetStatuses()
        {
            FormContext ctx = new FormContext();
            var StatusList = ctx.Statuses.ToList();

            return StatusList;
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:7,代码来源:OrderCancellationForm.aspx.cs


示例19: gvReport_RowDataBound

        protected void gvReport_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    Label lblRecordId = (Label)e.Row.FindControl("lblRecordId");
                    RadToolTip ttPO = (RadToolTip)e.Row.FindControl("ttPO");

                    string ltlPOHtml = "";

                    int recordId = Convert.ToInt32(lblRecordId.Text);

                    using (FormContext ctx = new FormContext())
                    {
                        var thisForm = ctx.MustIncludeForms.FirstOrDefault(x => x.RecordId == recordId);

                        ltlPOHtml += "<div style=\"border: 4px solid #d0604c; background-color: #FFF;\">Customer: " + thisForm.Customer + "<br /> Line: " + thisForm.Line + "</div>";

                        ttPO.Text = ltlPOHtml;
                    }
                }
            }
            catch
            {

            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:28,代码来源:ReportMustInclude.aspx.cs


示例20: GetExpediteCodes

        public IEnumerable<ExpediteCode> GetExpediteCodes()
        {
            using (FormContext ctx = new FormContext())
            {
                var ExpediteCodeList = ctx.ExpediteCodes.Where(c => c.Status == 1).OrderBy(c => c.ExpediteCodeID).Select(c => new { Code = c.Code + " - " + c.Description, ExpediteCodeID = c.ExpediteCodeID }).ToList()
                    .Select(x => new ExpediteCode { ExpediteCodeID = x.ExpediteCodeID, Code = x.Code });

                return ExpediteCodeList;
            }
        }
开发者ID:WCTingle,项目名称:InfoShare_Public,代码行数:10,代码来源:DirectOrderForm.aspx.cs



注:本文中的Tingle_WebForms.Models.FormContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Interfaces.tgDataRequest类代码示例发布时间:2022-05-26
下一篇:
C# TidyNet.Node类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap