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

C# WebControls.DetailsViewInsertEventArgs类代码示例

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

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



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

示例1: AddContactDetailsView_ItemInserting

        protected void AddContactDetailsView_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            string firstName = e.Values["FirstName"].ToString();
            string lastName = e.Values["LastName"].ToString();
            string city = e.Values["City"].ToString();
            string country = e.Values["Country"].ToString();
            string phone = e.Values["PhoneNumber"].ToString();
            string email = string.Empty;

            if (e.Values["Email"] != null)
                email = e.Values["Email"].ToString();
            else
            {
                email = "";
            }

            try
            {
                AddressBookRepository context = new AddressBookRepository();
                context.InsertContact(firstName, lastName, city, country, phone, email, User.Identity.Name);
                lblMessage.Text = "Contact Added: " + e.Values[0] + e.Values[1];
            }

            catch (OptimisticConcurrencyException ocex)
            {
                lblMessage.Text = ocex.ToString();
            }
            catch (Exception)
            {
                lblMessage.Text = "An error occured on inserting new contact. Try again.";
            }
        }
开发者ID:Tom2Filip,项目名称:AddressBook,代码行数:32,代码来源:AddContact.aspx.cs


示例2: AccountDetailsView_ItemInserting

 protected void AccountDetailsView_ItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     e.Values["CreatedTime"] = DateTime.Now;
     e.Values["ModifiedTime"] = DateTime.Now;
     e.Values["CompanyID"] = Convert.ToInt32(Session["CompanyID"]);
     e.Values["CreatedBy"] = Convert.ToInt64(Session["UserID"]);
 }
开发者ID:jasimuddin534,项目名称:jasim_basis,代码行数:7,代码来源:Contacts.aspx.cs


示例3: InsertItem

        protected void InsertItem(object sender, DetailsViewInsertEventArgs e)
        {
            TextBox question = (TextBox)DetailsView1.FindControl("NewPollQuestion");
            Snitz.BLL.Polls.AddTopicPoll(-1, question.Text, new SortedList<int, string>());

            Response.Redirect(Request.RawUrl);
        }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:7,代码来源:PollAdmin.ascx.cs


示例4: CampaignDetailsView_ItemInserting

        protected void CampaignDetailsView_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            long userid;
            if (String.IsNullOrEmpty(Session["CompanyID"].ToString())) { return; }
            else
            {
                e.Values["CompanyID"] = Convert.ToInt32(Session["CompanyID"]);
            }
            if (String.IsNullOrEmpty(Session["UserID"].ToString())) { return; }
            else
            {
                userid = Convert.ToInt64(Session["UserID"]);
            }

            if (Convert.ToInt32(CampaignStatusDropDownList.SelectedValue) == 0)
            {
                e.Values["CampaignStatusID"] = null;
            }
            else { e.Values["CampaignStatusID"] = CampaignStatusDropDownList.SelectedValue; }

            if (Convert.ToInt32(CampaignTypeDropDownList.SelectedValue) == 0) { e.Values["CampaignTypeID"] = null; }
            else { e.Values["CampaignTypeID"] = CampaignTypeDropDownList.SelectedValue; }
            if (Convert.ToInt32(CurrencyDropDownList.SelectedValue) == 0) { e.Values["CurrencyID"] = null; }
            else { e.Values["CurrencyID"] = CurrencyDropDownList.SelectedValue; }
            if (Convert.ToInt32(AssignedUserDropDownList.SelectedValue) == 0) { e.Values["AssignedUserID"] = null; }
            else { e.Values["AssignedUserID"] = AssignedUserDropDownList.SelectedValue; }
            if (Convert.ToInt32(TeamDropDownList.SelectedValue) == 0) { e.Values["TeamID"] = null; }
            else { e.Values["TeamID"] = TeamDropDownList.SelectedValue; }
            e.Values["CreatedBy"] = userid;
            e.Values["CreatedTime"] = DateTime.Now;
            e.Values["ModifiedBy"] = userid;
            e.Values["ModifiedTime"] = DateTime.Now;
        }
开发者ID:jasimuddin534,项目名称:jasim_basis,代码行数:33,代码来源:Campaigns.aspx.cs


示例5: DetailsView1_ItemInserting

        protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            CatalogManager manager = new CatalogManager();
            RequisitionItem item = new RequisitionItem();
            item.StationeryID = Convert.ToInt32(((DropDownList)DetailsView1.FindControl("stDDL")).SelectedValue);
            item.QuantityRequested = Convert.ToInt32(((TextBox)DetailsView1.FindControl("stTextBox")).Text);
            item.QuantityIssued = 0;
            item.Price = 0;

            if (requisition.RequisitionItems.Count == 0)
            {
                requisition.RequisitionItems.Add(item);
            }
            else
            {
                foreach (var req in requisition.RequisitionItems)
                {
                    if (item.StationeryID == req.StationeryID)
                    {
                        req.QuantityRequested += item.QuantityRequested;

                        break;
                    }
                    else
                    {
                        requisition.RequisitionItems.Add(item);
                        break;
                    }
                }

            }
            GridDataBind();
        }
开发者ID:chutinhha,项目名称:logic-university-stationery-store-inventory-system,代码行数:33,代码来源:StationeryRequest.aspx.cs


示例6: DetailsView2_ItemInserting

        protected void DetailsView2_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            XmlDocument xdoc = XmlDataSource4.GetXmlDocument();

            XmlElement FeedsList = xdoc.SelectSingleNode("/feeds") as XmlElement;
            XmlElement checkFeed = xdoc.SelectSingleNode("/feeds/feed[@name='" + e.Values["name"].ToString() + "']") as XmlElement;

            if (checkFeed == null)
            {
                XmlElement oFeed = xdoc.CreateElement("feed");

                XmlAttribute name = xdoc.CreateAttribute("name");
                XmlAttribute url = xdoc.CreateAttribute("url");

                name.Value = e.Values["name"].ToString();
                url.Value = e.Values["url"].ToString();

                oFeed.Attributes.Append(name);
                oFeed.Attributes.Append(url);

                FeedsList.AppendChild(oFeed);
                XmlDataSource4.Save();
                e.Cancel = true;
            }

            Response.Redirect(Request.RawUrl);
        }
开发者ID:dbtdsilva,项目名称:edc-aspnet,代码行数:27,代码来源:manageFeeds.aspx.cs


示例7: DetailsView1_ItemInserting

        protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {

            DropDownList dlist = DetailsView1.FindControl("ddlDepartment") as DropDownList;
            TextBox txtName = DetailsView1.FindControl("txtLoginName") as TextBox;
            TextBox txtPwd = DetailsView1.FindControl("txtPassword") as TextBox;
            CheckBox chkSuper = DetailsView1.FindControl("chkSuperAdmin") as CheckBox;

            if (dlist == null || txtName == null || txtPwd == null || chkSuper == null)
            {
                Response.Write("出错,不能获取相关控件");
                return;
            }
            int did=int.Parse(dlist.SelectedValue);
          
            AdminUserInfo a = new AdminUserInfo();
            a.LoginName = txtName.Text;
            a.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd.Text, "SHA1"); 
            a.DepartmentID = did;
            a.IsSuperAdmin = chkSuper.Checked;
            AdminUser.InsertAdminUser(a);
           this. ClientScript.RegisterStartupScript(this.GetType(), "Hint", "<script>alert('成功添加管理员信息')</script>");
            DetailsView1.Visible = false;
            GridView1.DataBind();
            e.Cancel = true;
        }
开发者ID:djzblue,项目名称:ExamOnline,代码行数:26,代码来源:AddAdmin.aspx.cs


示例8: dtlvCustomer_ItemInserting

        /// <summary>
        /// Handles the ItemInserting event of dtlvCustomer.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The DetailsViewInsertEventArgs.</param>
        protected void dtlvCustomer_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            if (this.IsValid)
            {
                try
                {
                    Poco::ICustomer newCustomer = this.GetCustomerObject();
                    using (Bll::ICustomer blCustomer = new Bll::Customer())
                    {
                        blCustomer.Create(newCustomer);
                    }

                    Response.Redirect("~/Customer.aspx"); // Go and show all data.
                }
                catch (SqlException ex)
                {
                    Response.Write(ex.ToString());
                }
                catch (ObjectDisposedException ex)
                {
                    Response.Write(ex.ToString());
                }
                catch (Exception ex)
                {
                    Response.Write(ex.ToString());
                }
            }
        }
开发者ID:Arnab-Developer,项目名称:MultilayeredArchitecture,代码行数:33,代码来源:ManageCustomer.aspx.cs


示例9: ExamDetailsView_ItemInserting

 protected void ExamDetailsView_ItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     if (tol > (dur * 0.2))
     {
         ShowMessageBox("Tolerance should be less than or equal to 20% of the duration.");
         ExamDetailsView.FindControl("txtTolerance").Focus();
         e.Cancel = true;
     }
 }
开发者ID:kaiss78,项目名称:olems,代码行数:9,代码来源:ExamManagement.aspx.cs


示例10: LeadDetailsView_ItemInserting

 protected void LeadDetailsView_ItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     e.Values["LeadSourceID"] = leadSourcesDropDownList.SelectedValue;
     e.Values["FirstName"] = contactsDropDownList.SelectedItem;
     e.Values["AccountID"] = accountsDropDownList.SelectedValue;
     e.Values["TeamID"] = teamsDropDownList.SelectedValue;
     e.Values["AssignedUserID"] = assignedToUsersDropDownList.SelectedValue;
     e.Values["LeadStatusID"] = leadStatusesDropDownList.SelectedValue;
 }
开发者ID:jasimuddin534,项目名称:jasim_basis,代码行数:9,代码来源:Leads1.aspx.cs


示例11: DetailsView1_ItemInserting

        protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            /*     Control file = DetailsView1.FindControl("FileUpload1");
               FileUpload fileUp;
            fileUp = ((FileUpload)file);

            fileUp.SaveAs(fileUp.FileName);
             */
        }
开发者ID:LuckyShard,项目名称:Reliquarium,代码行数:9,代码来源:TituloEdit.aspx.cs


示例12: DetailsView1_ItemInserting

 protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     SqlDataSource1.InsertParameters["moduleCode"].DefaultValue = ((TextBox)DetailsView1.Rows[0].Cells[1].FindControl("TextBox1")).Text;
     SqlDataSource1.InsertParameters["name"].DefaultValue = ((TextBox)DetailsView1.Rows[1].Cells[1].FindControl("TextBox2")).Text;
     SqlDataSource1.InsertParameters["GPA"].DefaultValue = ((RadioButtonList)DetailsView1.Rows[2].Cells[1].FindControl("RadioButtonList3")).SelectedItem.Text;
     SqlDataSource1.InsertParameters["credits"].DefaultValue = ((TextBox)DetailsView1.Rows[3].Cells[1].FindControl("TextBox3")).Text;
     SqlDataSource1.InsertParameters["compulary"].DefaultValue = ((RadioButtonList)DetailsView1.Rows[4].Cells[1].FindControl("RadioButtonList4")).SelectedItem.Text;
     SqlDataSource1.Insert();
 }
开发者ID:prasadmaduranga,项目名称:Performance-Analyzer,代码行数:9,代码来源:NewModule.aspx.cs


示例13: ContactDetailsView_ItemInserting

 protected void ContactDetailsView_ItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     e.Values["AccountID"] = AccountDropDownList.SelectedValue;
     e.Values["TeamID"] = TeamDropDownList.SelectedValue;
     e.Values["ReportsTo"] = ReportToDropDownList.SelectedValue;
     e.Values["AssignedTo"] = AssaigendToDropDownList.SelectedValue;
     e.Values["LeadSourcesID"] = LeadSourcesDropDownList.SelectedValue;
     e.Values["CreatedTime"] = DateTime.Now;
     e.Values["ModifiedTime"] = DateTime.Now;
     e.Values["CompanyID"] =7;
 }
开发者ID:jasimuddin534,项目名称:jasim_basis,代码行数:11,代码来源:ContactDetails.aspx.cs


示例14: QuestionDetailsView_ItemInserting

 protected void QuestionDetailsView_ItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     ApplyFilter();
     //question owner
     Question_SqlDataSource.InsertParameters["createdBy"].DefaultValue = HttpContext.Current.User.Identity.Name.ToString();
     //question image file
     FileUpload fUpload = (FileUpload)QuestionDetailsView.Rows[0].FindControl("imageFileUpload");
     String txtPath = "~/QuestionFiles/" + fUpload.FileName;
     Question_SqlDataSource.InsertParameters["questionFilePath"].DefaultValue = txtPath;
     LblError.Text = "";
 }
开发者ID:kaiss78,项目名称:olems,代码行数:11,代码来源:QuestionManagement.aspx.cs


示例15: DetailsView1_ItemInserting

 protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     if (e.Values["FileName"] != null)
     {
         string fileName = e.Values["FileName"].ToString();
         string newFileName = string.Format("{0}{1}{2}", Path.GetFileNameWithoutExtension(fileName),
                 Guid.NewGuid().ToString().Substring(0, 5), Path.GetExtension(fileName));
         e.Values["GameImage"] = newFileName;
         SaveLogoFile(newFileName);
     }
 }
开发者ID:shaileshgajula,项目名称:c8a5b00a-1d86-40ff-a172-35d865eeec09,代码行数:11,代码来源:Games.aspx.cs


示例16: PollAnswerInsert_ItemInserting

        protected void PollAnswerInsert_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            PollChoiceInfo choice = new PollChoiceInfo {PollId = Convert.ToInt32(Request.QueryString["pid"])};
            TextBox text = (TextBox) PollAnswerInsert.FindControl("NewPollAnswerDisplayText");
            TextBox order = (TextBox)PollAnswerInsert.FindControl("NewPollAnswerSortOrder");
            choice.DisplayText = text.Text;
            choice.Order = Convert.ToInt32(order.Text);
            Snitz.BLL.Polls.AddChoice(choice);

            Response.Redirect(Request.RawUrl);
        }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:11,代码来源:PollEdit.ascx.cs


示例17: dvwConsumation_ItemInserting

 protected void dvwConsumation_ItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     //if bought on is not empty, make sure it is converted to US date (workaround for a bug in control)
     if (e.Values["TastedOn"] != null)
     {
         e.Values["TastedOn"] = GUIHelper.GetUSDate(e.Values["TastedOn"].ToString());
     }
     //set created on and created by
     e.Values["CreatedOn"] = DateTime.Now;
     e.Values["CreatedBy"] = Membership.GetUser().UserName;
 }
开发者ID:blel,项目名称:ebalit,代码行数:11,代码来源:CreateConsumation.aspx.cs


示例18: CampaignDetailsView_ItemInserting

 protected void CampaignDetailsView_ItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     e.Values["CampaignStatusID"] = CampaignDropDownList.SelectedValue;
     e.Values["CampaignTypeID"] = CampaignTypeDropDownList.SelectedValue;
     e.Values["CurrencyID"] = CurrencyDropDownList.SelectedValue;
     e.Values["AssignedUserID"] = AssignedUserDropDownList.SelectedValue;
     e.Values["TeamID"] = TeamDropDownList.SelectedValue;
     e.Values["CreatedTime"] = DateTime.Now;
     e.Values["ModifiedTime"] = DateTime.Now;
     e.Values["CompanyID"] = 8;
 }
开发者ID:jasimuddin534,项目名称:jasim_basis,代码行数:11,代码来源:CampaignDetails.aspx.cs


示例19: DetailsView2_OnItemInserting

 protected void DetailsView2_OnItemInserting(object sender, DetailsViewInsertEventArgs e)
 {
     FileUpload fu = (FileUpload)DetailsView2.FindControl("uploadFoto");
     if (fu.PostedFile.ContentLength != 0)
     {
         string path = Server.MapPath(@"\Foto");
         path += "\\Temp.jpg";
         fu.PostedFile.SaveAs(path);
     }
     //ClientScript.RegisterStartupScript(
 }
开发者ID:an-kir,项目名称:List-Of-Students,代码行数:11,代码来源:index.aspx.cs


示例20: DetailsView1_ItemInserting

        protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            RequisitionItem item = new RequisitionItem();

            item.StationeryID = Convert.ToInt32(((DropDownList)DetailsView1.FindControl("StationeryDDL")).SelectedValue);
            item.QuantityRequested = Convert.ToInt32(((TextBox)DetailsView1.FindControl("QuantityTextBox")).Text);
            item.QuantityIssued = 0;
            item.Price = 0;

            Debug.WriteLine(item.StationeryID);
            Debug.WriteLine(item.QuantityRequested);
        }
开发者ID:chutinhha,项目名称:logic-university-stationery-store-inventory-system,代码行数:12,代码来源:TestWebForm1.aspx.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.DetailsViewInsertedEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.DetailsViewCommandEventArgs类代码示例发布时间: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