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


C# WebControls.FormViewUpdateEventArgs類代碼示例

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


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

示例1: FormView1_ItemUpdating

        protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            e.NewValues["logtime"] = DateTime.Now.ToString();

            e.NewValues["clerkid"] = Convert.ToInt32(Session["UserId"]);
            e.NewValues["repairsheetid"] = Convert.ToInt32(e.OldValues["repairsheetid"]);
        }
開發者ID:CSSource,項目名稱:WebServiceSystem,代碼行數:7,代碼來源:SheetLog.aspx.cs

示例2: fv_ItemUpdating

        protected void fv_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            if (this.fv.CurrentMode == FormViewMode.Edit)
            {
                var employeesListControl = this.fv.FindControl("employeesList") as CheckBoxList;

                if (employeesListControl != null)
                {
                    var ctx = new PubsEntities();
                    var jobID = Convert.ToInt16(this.fv.DataKey["job_id"]);
                    var currentJob = ctx.jobs.First(x => x.job_id == jobID);

                    foreach (var item in employeesListControl.Items.OfType<ListItem>())
                    {
                        var employee = ctx.employees.First(x => x.emp_id == item.Value);

                        if (item.Selected)
                        {
                            employee.job_id = jobID;
                        }
                    }

                    ctx.SaveChanges();
                }
            }
        }
開發者ID:gabla5,項目名稱:LearningProjects,代碼行數:26,代碼來源:WorkingWithTheFormViewControl.aspx.cs

示例3: FormView1_ItemUpdating

 protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     DropDownList title = (DropDownList)FormView1.FindControl("EditTitle");
       if (title != null)
       {
     e.NewValues.Add("TitleOfCourtesy", title.Text);
       }
 }
開發者ID:bq-wang,項目名稱:aspnet,代碼行數:8,代碼來源:DetailsView_FormView_Form.aspx.cs

示例4: FormView1_ItemUpdating

        protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            int tariffId = int.Parse(((DropDownList)FormView1.FindControl("TariffIdDropDownList")).SelectedValue);
            e.NewValues.Add("TariffId", tariffId);

            TextBox balanceTextBox = ((TextBox)FormView1.FindControl("BalanceTextBox"));
            if (balanceTextBox.Text == "")
                e.NewValues["Balance"] = (decimal?)0;
        }
開發者ID:OldFreelance,項目名稱:BillingSystem,代碼行數:9,代碼來源:EditUser.aspx.cs

示例5: frmCampoPlantilla_ItemUpdating

 protected void frmCampoPlantilla_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     if (e.NewValues["CMP_LONGITUD_CABECERA"].ToString() == string.Empty)
     {
         e.NewValues["CMP_LONGITUD_CABECERA"] = null;
     }
     if (e.NewValues["CMP_POSICION_RELATIVA"].ToString() == string.Empty)
     {
         e.NewValues["CMP_POSICION_RELATIVA"] = null;
     }
 }
開發者ID:jmptrader,項目名稱:Switch-Transaccional,代碼行數:11,代碼來源:ModificarCampoPlantilla.aspx.cs

示例6: FormView1_ItemUpdating

        protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            XmlDocument xdoc = XmlDataSource1.GetXmlDocument();
            XmlElement feed = xdoc.SelectSingleNode("feed/link[@name='" + e.OldValues[0].ToString() + "'][@url='" + e.OldValues[1].ToString() + "']") as XmlElement;
            feed.Attributes["url"].Value = e.NewValues["url"].ToString();

            XmlDataSource1.Save();
            XmlDataSource1.DataBind();

            e.Cancel = true;
            FormView1.ChangeMode(FormViewMode.ReadOnly);
        }
開發者ID:bsilvr,項目名稱:EDC2015-Trabalho4,代碼行數:12,代碼來源:manageFeed.aspx.cs

示例7: FormViewSheetInfo_ItemUpdating

        protected void FormViewSheetInfo_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            int state = Convert.ToInt32(e.NewValues["repairstateid"]);

            if (state >= 2 && state <= 4)
            { }
            else
            {
                Response.Write("<script language='javascript'>alert('沒有權限修改此項內容!')</script>");
                //ClientScript.RegisterStartupScript(this.GetType(), "JS", "請閱讀並勾選條款!");
                e.Cancel = true;
            }
        }
開發者ID:CSSource,項目名稱:WebServiceSystem,代碼行數:13,代碼來源:SheetDetail.aspx.cs

示例8: PGFV_ItemUpdating

        /**
         * We are in "edit" mode, and the "Update" button was pressed
         * */
        protected void PGFV_ItemUpdating(Object sender, FormViewUpdateEventArgs e)
        {
            String id = ((TextBox)this.PGFV.FindControl("albumIdTextBox")).Text;
            String albumName = ((TextBox)this.PGFV.FindControl("albumNameTextBox")).Text;
            String albumDescription = ((TextBox)this.PGFV.FindControl("albumDescTextBox")).Text;

            //Update table
            controller.updateAlbum(Int32.Parse(id), albumName, albumDescription);

            //update the grid
            rebind(); //rebind the grid

            //Change the form view mode
            this.PGFV.ChangeMode(FormViewMode.ReadOnly);
            rebindForm(-1);
        }
開發者ID:jovinoribeiro,項目名稱:EBFRW,代碼行數:19,代碼來源:PhotoGalleryEditor.aspx.cs

示例9: frmProtocolo_ItemUpdating

        protected void frmProtocolo_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            if (e.NewValues["PTR_PUERTO"].ToString() == string.Empty)
            {
                e.NewValues["PTR_PUERTO"] = null;
            }
            if (e.NewValues["PTR_TIMEOUT_REQUEST"].ToString() == string.Empty)
            {
                e.NewValues["PTR_TIMEOUT_REQUEST"] = null;
            }

            if (e.NewValues["PTR_TIMEOUT_RESPONSE"].ToString() == string.Empty)
            {
                e.NewValues["PTR_TIMEOUT_RESPONSE"] = null;
            }
        }
開發者ID:jmptrader,項目名稱:Switch-Transaccional,代碼行數:16,代碼來源:ModificarProtocolo.aspx.cs

示例10: fvCompleteBackAdd_ItemUpdating

 protected void fvCompleteBackAdd_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     //取消請求執行自定義的方法
     e.Cancel = true;
     //檢測是否含有session
     if (Session.Count < 5)
     {
         //跳轉
         Response.Redirect("/Account/Login", true);
         //停止加載後續內容
         Response.End();
         //直接返回
         return;
     }
     //當前用戶所在部門
     string procName = Session["proc_name"].ToString();
     //當前角色id
     Int16 roleId = Convert.ToInt16(Session["role_id"]);
     //檢測是否有權限
     if (procName != mustProcName || roleId < 0 || roleId > 4)
     {
         throw new Exception("您沒有修改記錄權限!");
     }
     //用戶輸入不合法不執行添加操作
     if (!CheckUserInput())
     {
         return;
     }
     //設置錄入員姓名和時間
     e.NewValues["add_person"] = Session["user_name"].ToString();
     e.NewValues["last_change_time"] = DateTime.Now;
     //當前單號
     string billNum = Convert.ToString(e.Keys[0]);
     //根據參數執行更新數據
     if (UpdateData(e))
     {
         //調用過程執行跳轉
         JumpToUrlByBillNum(billNum);
     }
 }
開發者ID:yangdan8,項目名稱:ydERPGJ,代碼行數:40,代碼來源:CompleteBackAdd.aspx.cs

示例11: DoOnItemUpdating

			public void DoOnItemUpdating (FormViewUpdateEventArgs e)
			{
				OnItemUpdating (e); 
			}
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:4,代碼來源:FormViewTest.cs

示例12: fv_ItemUpdating

		private void fv_ItemUpdating (object sender, FormViewUpdateEventArgs e)
		{
			itemUpdating = true;
		}
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:4,代碼來源:FormViewTest.cs

示例13: fvProductNoticeAdd_ItemUpdating

 protected void fvProductNoticeAdd_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     //默認取消請求
     e.Cancel = true;
     //檢測是否含有session
     if (Session.Count < 5)
     {
         //跳轉
         Response.Redirect("/Account/Login", true);
         //停止加載後續內容
         Response.End();
         //直接返回
         return;
     }
     //當前用戶所在部門
     string procName = Session["proc_name"].ToString();
     //當前角色id
     Int16 roleId = Convert.ToInt16(Session["role_id"]);
     //檢測是否有權限
     if (!(new string[] { "PMC", mustProcName }).Contains(procName) || roleId < 0 || roleId > 4)
     {
         throw new Exception("您沒有修改記錄權限!");
     }
     //檢測是否需要保存表頭
     if (canEditHeadRow)
     {
         //設置錄入員姓名和時間
         e.NewValues["add_person"] = Session["user_name"].ToString();
         e.NewValues["last_change_time"] = DateTime.Now;
     }
     //當前單號
     var billNum = Convert.ToString(e.Keys[0]);
     //根據參數執行更新數據
     if (UpdateData(e))
     {
         //調用過程執行跳轉
         JumpToUrlByBillNum(billNum);
     }
 }
開發者ID:yangdan8,項目名稱:ydERPGJ,代碼行數:39,代碼來源:ProductNoticeAdd.aspx.cs

示例14: UpdateData

        /// <summary>
        /// 根據輸入的參數保存到數據庫
        /// </summary>
        /// <param name="e">傳入的帶有數據的事件參數</param>
        /// <returns></returns>
        private bool UpdateData(FormViewUpdateEventArgs e)
        {
            //數據適配器
            //當前添加語句對象
            //當前數據庫連接
            using (var da = new t_proc_lot_card_balanceTableAdapter())
            using (var daChange = new t_proc_lot_card_balance_changeTableAdapter())
            using (var cmd = da.Adapter.InsertCommand)
            using (var conn = cmd.Connection)
            {
                //打開數據庫連接
                conn.Open();
                //設置數據庫連接
                da.Connection = daChange.Connection = cmd.Connection = conn;
                //開啟事務
                using (var tran = conn.BeginTransaction())
                {
                    //設置事務
                    da.Transaction = daChange.Transaction = cmd.Transaction = tran;
                    //試運行
                    try
                    {
                        //執行保存數據
                        if (da.UpdateData(
                            e.NewValues["prev_proc_name"].ToString(),
                            e.NewValues["proc_name"].ToString(),
                            e.NewValues["lot_id"].ToString(),
                            e.NewValues["product_num"].ToString(),
                            Convert.ToInt32(e.NewValues["pnl_qty"]),
                            Convert.ToInt32(e.NewValues["pcs_qty"]),
                            e.NewValues["remark"] == null ? null : e.NewValues["remark"].ToString(),
                            e.NewValues["add_person"].ToString(),
                            Convert.ToDateTime(e.NewValues["add_time"]),
                            Convert.ToDateTime(e.NewValues["last_change_time"]),
                            e.NewValues["accept_person"] == null ? null : e.NewValues["accept_person"].ToString(),
                            e.NewValues["accept_time"] == null ? null : (DateTime?)e.NewValues["accept_time"],
                            Convert.ToBoolean(e.NewValues["is_complete_wenzi"]),
                            Convert.ToInt64(e.Keys[0])
                        ) <= 0)
                        {
                            //拋出錯誤
                            throw new Exception("修改部門批量卡結存發生錯誤!");
                        }
                        //取得一個相關guid
                        var guid = Guid.NewGuid().ToString();
                        //保存到修改記錄表
                        if (daChange.InsertData(
                            e.OldValues["prev_proc_name"].ToString(),
                            e.OldValues["proc_name"].ToString(),
                            e.OldValues["lot_id"].ToString(),
                            e.OldValues["product_num"].ToString(),
                            Convert.ToInt32(e.OldValues["pnl_qty"]),
                            Convert.ToInt32(e.OldValues["pcs_qty"]),
                            e.OldValues["remark"] == null ? null : e.OldValues["remark"].ToString(),
                            e.OldValues["add_person"].ToString(),
                            e.OldValues["accept_person"] == null ? null : e.OldValues["accept_person"].ToString(),
                            e.OldValues["accept_time"] == null ? null : (DateTime?)e.OldValues["accept_time"],
                            Convert.ToBoolean(e.OldValues["is_complete_wenzi"]),
                            false,
                            guid
                        ) <= 0)
                        {
                            //拋出錯誤
                            throw new Exception("添加修改批量卡結存舊數據日誌記錄發生錯誤!");
                        }
                        //保存到修改記錄表
                        if (daChange.InsertData(
                            e.NewValues["prev_proc_name"].ToString(),
                            e.NewValues["proc_name"].ToString(),
                            e.NewValues["lot_id"].ToString(),
                            e.NewValues["product_num"].ToString(),
                            Convert.ToInt32(e.NewValues["pnl_qty"]),
                            Convert.ToInt32(e.NewValues["pcs_qty"]),
                            e.NewValues["remark"] == null ? null : e.NewValues["remark"].ToString(),
                            e.NewValues["add_person"].ToString(),
                            e.NewValues["accept_person"] == null ? null : e.NewValues["accept_person"].ToString(),
                            e.NewValues["accept_time"] == null ? null : (DateTime?)e.NewValues["accept_time"],
                            Convert.ToBoolean(e.NewValues["is_complete_wenzi"]),
                            true,
                            guid
                        ) <= 0)
                        {
                            //拋出錯誤
                            throw new Exception("添加修改批量卡結存新數據日誌記錄發生錯誤!");
                        }

                        //提交事務
                        tran.Commit();
                        //返回成功
                        return true;
                    }
                    catch (Exception ex)
                    {
                        //回滾事務
                        tran.Rollback();
//.........這裏部分代碼省略.........
開發者ID:yangdan8,項目名稱:ydERPGJ,代碼行數:101,代碼來源:ProcLotCardMgrAdd.aspx.cs

示例15: fvReport_ItemUpdating

        protected void fvReport_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            if (IsValid)
            {
                int id = Convert.ToInt32(((Label)fvReport.FindControl("lblRecordId")).Text);

                Tingle_WebForms.Models.MustIncludeForm myForm = ctx.MustIncludeForms.FirstOrDefault(eof => eof.RecordId == id);

                RadDropDownList ddlCompanyEdit = (RadDropDownList)fvReport.FindControl("ddlCompanyEdit");
                TextBox txtPO = (TextBox)fvReport.FindControl("txtPOEdit");
                TextBox txtArmstrongReference = (TextBox)fvReport.FindControl("txtArmstrongReferenceEdit");
                TextBox txtPattern = (TextBox)fvReport.FindControl("txtPatternEdit");
                TextBox txtLine = (TextBox)fvReport.FindControl("txtLineEdit");
                TextBox txtOrderNumber = (TextBox)fvReport.FindControl("txtOrderNumberEdit");
                TextBox txtCustomer = (TextBox)fvReport.FindControl("txtCustomerEdit");
                RadDropDownList ddlWarehouse = (RadDropDownList)fvReport.FindControl("ddlWarehouseEdit");
                HtmlInputText txtDueByDate = (HtmlInputText)fvReport.FindControl("txtDueByDateEdit");
                RadDropDownList ddlStatus = (RadDropDownList)fvReport.FindControl("ddlStatusEdit");
                int statusId = Convert.ToInt32(ddlStatus.SelectedValue);
                RadComboBox ddlRequestedByEdit = (RadComboBox)fvReport.FindControl("ddlRequestedByEdit");
                int requestedById = Convert.ToInt32(ddlRequestedByEdit.SelectedValue);
                RadComboBox ddlAssignedToEdit = (RadComboBox)fvReport.FindControl("ddlAssignedToEdit");
                int assignedToId = 0;
                if (ddlAssignedToEdit.SelectedIndex != -1)
                {
                    assignedToId = Convert.ToInt32(ddlAssignedToEdit.SelectedValue);
                }
                RadDropDownList ddlPriorityEdit = (RadDropDownList)fvReport.FindControl("ddlPriorityEdit");
                int priorityId = Convert.ToInt32(ddlPriorityEdit.SelectedValue);
                CheckBox cbSendComments = (CheckBox)fvReport.FindControl("cbSendComments");
                CheckBox cbShowSystemComments = (CheckBox)fvReport.FindControl("cbShowSystemComments");
                CheckBox cbNotifyStandard = (CheckBox)fvReport.FindControl("cbNotifyStandard");
                CheckBox cbNotifyAssignee = (CheckBox)fvReport.FindControl("cbNotifyAssignee");
                CheckBox cbNotifyOther = (CheckBox)fvReport.FindControl("cbNotifyOther");
                CheckBox cbNotifyRequester = (CheckBox)fvReport.FindControl("cbNotifyRequester");
                RadComboBox ddlNotifyOther = (RadComboBox)fvReport.FindControl("ddlNotifyOther");

                Label lblEmailsSentTo = (Label)fvReport.FindControl("lblEmailsSentTo");
                Label lblFVMessage = (Label)fvReport.FindControl("lblFVMessage");

                DateTime tryDateDue;
                Nullable<DateTime> dateDue = null;

                try
                {
                    if (myForm.RequestedUser.SystemUserID.ToString() != ddlRequestedByEdit.SelectedValue)
                    {
                        Comments newRequesterComment = new Comments
                        {
                            Form = ctx.TForms.FirstOrDefault(x => x.FormName == "Must Include"),
                            Note = "Requester Changed To: " + ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == requestedById).DisplayName,
                            RelatedFormId = myForm.RecordId,
                            SystemComment = true,
                            Timestamp = DateTime.Now
                        };

                        ctx.Comments.Add(newRequesterComment);
                    }

                    if (myForm.AssignedUser == null && ddlAssignedToEdit.SelectedIndex != -1) // (myForm.AssignedUser != null && ddlAssignedToEdit.SelectedIndex != -1 && Convert.ToString(myForm.AssignedUser.SystemUserID) != ddlAssignedToEdit.SelectedValue))
                    {
                        Comments newAssignedComment = new Comments
                        {
                            Form = ctx.TForms.FirstOrDefault(x => x.FormName == "Must Include"),
                            Note = "Request Assigned To: " + ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == assignedToId).DisplayName,
                            RelatedFormId = myForm.RecordId,
                            SystemComment = true,
                            Timestamp = DateTime.Now
                        };

                        ctx.Comments.Add(newAssignedComment);
                    }
                    else if (myForm.AssignedUser != null && ddlAssignedToEdit.SelectedIndex != -1)
                    {
                        if (myForm.AssignedUser.SystemUserID.ToString() != ddlAssignedToEdit.SelectedValue)
                        {
                            Comments newAssignedComment = new Comments
                            {
                                Form = ctx.TForms.FirstOrDefault(x => x.FormName == "Must Include"),
                                Note = "Request Assignee Changed To: " + ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == assignedToId).DisplayName,
                                RelatedFormId = myForm.RecordId,
                                SystemComment = true,
                                Timestamp = DateTime.Now
                            };

                            ctx.Comments.Add(newAssignedComment);
                        }
                    }
                    else if (myForm.AssignedUser != null && ddlAssignedToEdit.SelectedIndex == -1)
                    {
                        Comments newAssignedComment = new Comments
                        {
                            Form = ctx.TForms.FirstOrDefault(x => x.FormName == "Must Include"),
                            Note = "Request Assignment Removed From: " + ctx.SystemUsers.FirstOrDefault(x => x.SystemUserID == myForm.AssignedUser.SystemUserID).DisplayName,
                            RelatedFormId = myForm.RecordId,
                            SystemComment = true,
                            Timestamp = DateTime.Now
                        };

                        ctx.Comments.Add(newAssignedComment);
//.........這裏部分代碼省略.........
開發者ID:WCTingle,項目名稱:InfoShare_Public,代碼行數:101,代碼來源:ReportMustInclude.aspx.cs


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