當前位置: 首頁>>代碼示例>>C#>>正文


C# WebControls.DetailsViewInsertEventArgs類代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.DetailsViewInsertEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# DetailsViewInsertEventArgs類的具體用法?C# DetailsViewInsertEventArgs怎麽用?C# DetailsViewInsertEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DetailsViewInsertEventArgs類屬於System.Web.UI.WebControls命名空間,在下文中一共展示了DetailsViewInsertEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的System.Web.UI.WebControls.DetailsViewInsertEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。