本文整理汇总了C#中System.Web.UI.WebControls.FormViewInsertEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# FormViewInsertEventArgs类的具体用法?C# FormViewInsertEventArgs怎么用?C# FormViewInsertEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FormViewInsertEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了FormViewInsertEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: fvProject_ItemInserting
protected void fvProject_ItemInserting(object sender, FormViewInsertEventArgs e)
{
//TODO: Set value of Project Account and CreateBy field
e.Values["Account"] = SEOMembershipManager.GetUser(User.Identity.Name).Account;
e.Values["CreateBy"] = User.Identity.Name;
}
开发者ID:Learion,项目名称:BruceToolSet,代码行数:7,代码来源:ManageProject.aspx.cs
示例2: FormView1_ItemInserting
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
e.Values["Incidente"] = getNewIncidente().ToString();
e.Values["Usuario"] = BitOP.Global.Usuario;
e.Values["Planta"] = SelPlanta.Text;
e.Values["Area"] = SelArea.Text;
e.Values["Proceso"] = SelProceso.Text;
}
开发者ID:aulloas,项目名称:Repo1,代码行数:8,代码来源:Registro+Incidentes.aspx.cs
示例3: FormView1_ItemInserting
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
BillingEntities db=new BillingEntities();
User user = db.Users.FirstOrDefault(s => s.Login == User.Identity.Name);
e.Values.Add("UserFromId", user.Id);
e.Values.Add("UserToId", int.Parse(Request.Params["Id"]));
e.Values.Add("IsReaded", false);
}
开发者ID:OldFreelance,项目名称:BillingSystem,代码行数:8,代码来源:WriteTo.aspx.cs
示例4: FormView1_ItemInserting
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
int tariffId = int.Parse(((DropDownList)FormView1.FindControl("TariffIdDropDownList")).SelectedValue);
e.Values.Add("TariffId", tariffId);
TextBox balanceTextBox = ((TextBox)FormView1.FindControl("BalanceTextBox"));
if (balanceTextBox.Text == "")
e.Values["Balance"] = (decimal?)0;
}
开发者ID:OldFreelance,项目名称:BillingSystem,代码行数:9,代码来源:EditUser.aspx.cs
示例5: frmCampoPlantilla_ItemInserting
protected void frmCampoPlantilla_ItemInserting(object sender, FormViewInsertEventArgs e)
{
if (e.Values["CMP_LONGITUD_CABECERA"].ToString() == string.Empty)
{
e.Values["CMP_LONGITUD_CABECERA"] = null;
}
if (e.Values["CMP_POSICION_RELATIVA"].ToString() == string.Empty)
{
e.Values["CMP_POSICION_RELATIVA"] = null;
}
}
开发者ID:jmptrader,项目名称:Switch-Transaccional,代码行数:11,代码来源:AgregarCampoPlantilla.aspx.cs
示例6: FormView1_ItemInserting
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
FileUpload fileUpload = FormView1.FindControl("fileUpload") as FileUpload;
e.Values.Add("FileVersion", Path.GetFileNameWithoutExtension(fileUpload.FileName));
e.Values.Add("FileName", Path.GetFileName(fileUpload.FileName));
e.Values.Add("FileBytes", fileUpload.FileBytes);
e.Values.Add("PostTime", DateTime.Now);
string savingType = drpSavingType2.SelectedValue;
e.Values.Add("SavingType", savingType);
}
开发者ID:kinpauln,项目名称:FreightForwarder,代码行数:11,代码来源:Default.aspx.cs
示例7: PGFV_ItemInserting
/**
* We are in "insert" mode, and the "insert" button was pressed
* */
protected void PGFV_ItemInserting(Object sender, FormViewInsertEventArgs e)
{
String albumName = ((TextBox)this.PGFV.FindControl("albumNameTextBox")).Text;
String albumDescription = ((TextBox)this.PGFV.FindControl("albumDescTextBox")).Text;
//Create new entry
controller.createNewAlbum(albumName, albumDescription);
rebind(); //rebind the grid
//now, find the id to select it on the Grid
this.PGFV.ChangeMode(FormViewMode.ReadOnly);
rebindForm(-1);
}
开发者ID:jovinoribeiro,项目名称:EBFRW,代码行数:15,代码来源:PhotoGalleryEditor.aspx.cs
示例8: InsertOneRecord
//******添加数据使用的函数和方法******
/// <summary>
/// 添加一条生产记录或者报废记录数据到数据库
/// </summary>
/// <param name="cmd">查询对象</param>
/// <param name="lotId">lot卡号</param>
/// <param name="e">包含有数据列表值的事件参数</param>
/// <param name="isToNextDept">是否转入下部门结存</param>
/// <returns></returns>
internal static bool InsertOneRecord(
SqlCommand cmd,
string lotId,
FormViewInsertEventArgs e,
bool isToNextDept = true
)
{
//当前部门
string deptName = HttpContext.Current.Session["dept_name"].ToString();
//调用另一重载函数
return InsertOneRecord(cmd, lotId, e, string.Empty, deptName, isToNextDept);
}
开发者ID:yangdan8,项目名称:ydERPTY,代码行数:21,代码来源:ydOperateBalanceLotCrad.cs
示例9: InsertOneRecord
//******添加数据使用的函数和方法******
/// <summary>
/// 添加一条生产记录或者报废记录数据到数据库
/// </summary>
/// <param name="cmd">查询对象</param>
/// <param name="lotId">批量卡序号</param>
/// <param name="e">包含有数据列表值的事件参数</param>
/// <param name="isToNextProc">是否转入下部门结存</param>
/// <param name="isAccept">是否已经确认过该卡数量</param>
/// <returns></returns>
internal static bool InsertOneRecord(
SqlCommand cmd,
string lotId,
FormViewInsertEventArgs e,
bool isToNextProc = true,
bool? isAccept = true
)
{
//当前部门
string procName = HttpContext.Current.Session["proc_name"].ToString();
//调用另一重载函数
return InsertOneRecord(cmd, lotId, e, procName, isToNextProc, isAccept);
}
开发者ID:yangdan8,项目名称:ydERPGJ,代码行数:23,代码来源:ydOperateBalanceLotCrad.cs
示例10: PrideRunOrdersEditorFormView_ItemInserting
/**
* Currently NOT used
* We are in "insert" mode, and the "insert" button was pressed
* */
protected void PrideRunOrdersEditorFormView_ItemInserting(Object sender, FormViewInsertEventArgs e)
{
String firstName = ((TextBox)PrideRunOrdersEditorFormView.FindControl("firstNameTextBox")).Text;
String lastName = ((TextBox)PrideRunOrdersEditorFormView.FindControl("lastNameTextBox")).Text;
String email = ((TextBox)PrideRunOrdersEditorFormView.FindControl("emailTextBox")).Text;
//Response.Write("Inserting...<br>");
//Response.Write(eventName + "," + distance + "," + city + "," + state + "," + website + "," + cal.ToShortDateString());
controller.insertAMember(firstName, lastName, email);
rebind(); //rebind the grid
PrideRunOrdersEditorFormView.ChangeMode(FormViewMode.ReadOnly);
rebindForm(-1);
}
开发者ID:jovinoribeiro,项目名称:EBFRW,代码行数:19,代码来源:PrideRunOrdersEditor.aspx.cs
示例11: FormView1_ItemInserting
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
DropDownList UsuarioSel = (DropDownList)FormView1.FindControl("DropDownListUsuario");
DropDownList AreaSel = (DropDownList)FormView1.FindControl("DropDownListArea");
DropDownList ProcesoSel = (DropDownList)FormView1.FindControl("DropDownListProceso");
DropDownList EquipoSel = (DropDownList)FormView1.FindControl("DropDownListEquipo");
DropDownList TurnoSel = (DropDownList)FormView1.FindControl("DropDownListTurno");
DropDownList DiasPermSel = (DropDownList)FormView1.FindControl("DropDownListDiasPerm");
e.Values["Usuario"] = UsuarioSel.SelectedValue.ToString();
e.Values["Area"] = AreaSel.SelectedValue.ToString();
e.Values["Proceso"] = ProcesoSel.SelectedValue.ToString();
e.Values["Equipo"] = EquipoSel.SelectedValue.ToString();
e.Values["Turno"] = TurnoSel.SelectedValue.ToString();
e.Values["DiasAtrasoReg"] = Convert.ToInt16(DiasPermSel.SelectedValue.ToString());
}
开发者ID:aulloas,项目名称:Repo1,代码行数:16,代码来源:UsuarioFuncion.aspx.cs
示例12: frmProtocolo_ItemInserting
protected void frmProtocolo_ItemInserting(object sender, FormViewInsertEventArgs e)
{
if (e.Values["PTR_PUERTO"].ToString() == string.Empty)
{
e.Values["PTR_PUERTO"] = null;
}
if (e.Values["PTR_TIMEOUT_REQUEST"].ToString() == string.Empty)
{
e.Values["PTR_TIMEOUT_REQUEST"] = null;
}
if (e.Values["PTR_TIMEOUT_RESPONSE"].ToString() == string.Empty)
{
e.Values["PTR_TIMEOUT_RESPONSE"] = null;
}
if (e.Values["PTR_FRAME"].ToString() == string.Empty)
{
e.Values["PTR_FRAME"] = null;
}
}
开发者ID:jmptrader,项目名称:Switch-Transaccional,代码行数:22,代码来源:AgregarProtocolo.aspx.cs
示例13: EventEditorFormView_ItemInserting
/**
* We are in "insert" mode, and the "insert" button was pressed
* */
protected void EventEditorFormView_ItemInserting(Object sender, FormViewInsertEventArgs e)
{
String eventName = ((TextBox)EventEditorFormView.FindControl("eventNameTextBox")).Text;
eventName = eventName.Replace("'", "''");
String distance = ((TextBox)EventEditorFormView.FindControl("distanceTextBox")).Text;
String city = ((TextBox)EventEditorFormView.FindControl("cityTextBox")).Text;
String state = ((TextBox)EventEditorFormView.FindControl("stateTextBox")).Text;
String website = ((TextBox)EventEditorFormView.FindControl("websiteTextBox")).Text;
//DateTime cal = (DateTime)((CalendarExtender)EventEditorFormView.FindControl("calendartest")).SelectedDate;
String date = ((TextBox)EventEditorFormView.FindControl("eventDateTextBox")).Text;
String[] splitDate = date.Split('/');
DateTime cal = new DateTime(Int32.Parse(splitDate[2]), Int32.Parse(splitDate[0]), Int32.Parse(splitDate[1]));
//Response.Write("Inserting...<br>");
//Response.Write(eventName + "," + distance + "," + city + "," + state + "," + website + "," + cal.ToShortDateString());
controller.createNewEvent(cal, eventName, distance, city, state, website);
rebind(); //rebind the grid
//now, find the id to select it on the Grid
EventEditorFormView.ChangeMode(FormViewMode.ReadOnly);
rebindForm(-1);
//Response.Write("Inserting");
}
开发者ID:jovinoribeiro,项目名称:EBFRW,代码行数:26,代码来源:EventEditor.aspx.cs
示例14: formFeeds_ItemInserting
protected void formFeeds_ItemInserting(object sender, FormViewInsertEventArgs e)
{
XmlDocument xdoc = XmlDataSource_feed.GetXmlDocument();
XmlElement feeds = xdoc.SelectSingleNode("feeds") as XmlElement;
XmlElement feed = xdoc.CreateElement("feed");
XmlAttribute name = xdoc.CreateAttribute("name");
XmlAttribute url = xdoc.CreateAttribute("url");
name.InnerText = ((TextBox)formFeeds.Row.Cells[0].FindControl("nameInsert")).Text;
url.InnerText = ((TextBox)formFeeds.Row.Cells[0].FindControl("urlInsert")).Text;
feeds.AppendChild(feed);
feed.Attributes.Append(name);
feed.Attributes.Append(url);
XmlDataSource_feed.Save();
XmlDataSource_feed.DataBind();
formFeeds.DataBind();
formFeeds.ChangeMode(FormViewMode.ReadOnly);
e.Cancel = true;
}
开发者ID:rafaelferreirapt,项目名称:edc,代码行数:23,代码来源:manageFeeds.aspx.cs
示例15: d_ItemInserting
static void d_ItemInserting (object sender, FormViewInsertEventArgs e)
{
if (WebTest.CurrentTest.UserData == null) {
ArrayList list = new ArrayList ();
list.Add ("ItemInserting");
WebTest.CurrentTest.UserData = list;
}
else {
ArrayList list = WebTest.CurrentTest.UserData as ArrayList;
if (list == null)
throw new NullReferenceException ();
list.Add ("ItemInserting");
WebTest.CurrentTest.UserData = list;
}
}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:15,代码来源:FormViewTest.cs
示例16: InsertData
/// <summary>
/// 根据输入的内容添加数据到数据库
/// </summary>
/// <param name="e">传入的带有数据的事件参数</param>
/// <returns></returns>
private bool InsertData(FormViewInsertEventArgs e)
{
//数据适配器
using (var daHead = new t_product_notice_headTableAdapter())
using (var daContent = new t_product_notice_contentTableAdapter())
using (var conn = daHead.Connection)
{
//打开数据库连接
conn.Open();
//设置数据库连接
daContent.Connection = conn;
//开启事务
using (var tran = conn.BeginTransaction(IsolationLevel.RepeatableRead))
{
//尝试运行
try
{
//设置事务
daHead.Transaction = daContent.Transaction = tran;
//当前行单号
var billNum = Convert.ToString(e.Values["bill_num"]);
//检测是否需要保存表身
if (canEditSonRow)
{
//获取表身内容
var rowId = Request.Form.GetValues("row_id");
var materialType = Request.Form.GetValues("material_type");
var materialCode = Request.Form.GetValues("material_code");
var materialName = Request.Form.GetValues("material_name");
var materialSize = Request.Form.GetValues("material_size");
var materialUnit = Request.Form.GetValues("material_unit");
var materialPnlLength = Request.Form.GetValues("material_pnl_length");
var materialPnlWidth = Request.Form.GetValues("material_pnl_width");
var materialPnlCountPcs = Request.Form.GetValues("material_pnl_count_pcs");
var materialPnlQty = Request.Form.GetValues("material_pnl_qty");
//取得表身内保存的行数
var iCountContentRow = 0;
//遍历保存表身内容
for (int i = 0; i < rowId.Length; i++)
{
//有数据才保存
if (
materialType[i].Trim().Length > 0 ||
materialCode[i].Trim().Length > 0 ||
materialName[i].Trim().Length > 0 ||
materialUnit[i].Trim().Length > 0 ||
materialPnlLength[i].Trim().Length > 0 ||
materialPnlWidth[i].Trim().Length > 0 ||
materialPnlCountPcs[i].Trim().Length > 0 ||
materialPnlQty[i].Trim().Length > 0
)
{
//执行保存
daContent.Insert(
billNum,
Convert.ToByte(rowId[i]),
Convert.ToString(materialType[i]),
Convert.ToString(materialCode[i]),
Convert.ToString(materialName[i]),
Convert.ToString(materialSize[i]),
Convert.ToString(materialUnit[i]),
Convert.ToDecimal(materialPnlLength[i]),
Convert.ToDecimal(materialPnlWidth[i]),
Convert.ToInt32(materialPnlCountPcs[i]),
Convert.ToDecimal(materialPnlQty[i])
);
//累加行数
iCountContentRow++;
}
}
//检测行数
if (iCountContentRow <= 0)
{
//抛出错误
throw new Exception("单据无内容不能保存!");
}
}
//检测是否需要保存表头
if (canEditHeadRow)
{
//保存表头
daHead.Insert(
Convert.ToDateTime(e.Values["bill_date"]),
billNum,
Convert.ToString(e.Values["order_id"]),
Convert.ToString(e.Values["remark"]),
Convert.ToString(e.Values["add_person"]),
Convert.ToDateTime(e.Values["add_time"]),
Convert.ToDateTime(e.Values["last_change_time"])
);
}
//提交事务
tran.Commit();
//返回成功
return true;
//.........这里部分代码省略.........
开发者ID:yangdan8,项目名称:ydERPGJ,代码行数:101,代码来源:ProductNoticeAdd.aspx.cs
示例17: fv_ItemInserting
private void fv_ItemInserting (object sender, FormViewInsertEventArgs e)
{
itemInserting = true;
}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:4,代码来源:FormViewTest.cs
示例18: InsertData
/// <summary>
/// 根据输入的LOT格式来保存多条数据到数据库
/// </summary>
/// <param name="e">传入的带有数据的事件参数</param>
/// <param name="procName">当前部门名称</param>
/// <returns></returns>
private bool InsertData(FormViewInsertEventArgs e, string procName)
{
//当前用户输入的批量卡号
string strLotIdBegin = e.Values["lot_id"].ToString();
//当前用户输入的结束批量卡号
string strLotIdEnd = ((TextBox)fvProductRecordAdd.FindControl("txtLotIdEnd")).Text.Trim();
//数据适配器
//当前添加语句对象
//当前数据库连接
using (var da = new t_product_record_wenziTableAdapter())
using (var cmd = da.Adapter.InsertCommand)
using (var conn = cmd.Connection)
{
//打开数据库连接
conn.Open();
//开启事务
using (var tran = conn.BeginTransaction())
{
//设置事务
da.Transaction = tran;
//试运行
try
{
//检测是否有结束批量卡号
if (strLotIdEnd.Length == 0)
{
//检测批量卡是否正确
//正则表达式
string strReg = @"^[1-9]\d(0[1-9]|1[012])-S?[1-9]\d{0,4}";
//检测是否正确批量卡号
if (!Regex.IsMatch(strLotIdBegin, strReg))
{
//非数字返回失败
throw new Exception("您输入了一个不合格的批量卡号 " + strLotIdBegin + " !");
}
//检测是否最小批量卡号
if (!ydPublicMethod.IsMinLotId(tran, procName, strLotIdBegin))
{
//直接返回
return false;
}
//保存一条记录到数据库
if (!ydOperateBalanceLotCrad.InsertOneRecord(cmd, strLotIdBegin, e))
{
//失败就直接返回
return false;
}
}
else
{
//正则表达式
string strReg = @"^[1-9]\d{0,4}$";
//检测是否正确批量卡号
if (!Regex.IsMatch(strLotIdEnd, strReg))
{
//非数字返回失败
throw new Exception("您输入了一个不合格的结束批量卡号 " + strLotIdEnd + " !");
}
//检测是否样板
bool isSample = strLotIdBegin.ToUpper().Contains("S");
//批量卡中的年份月份和数字索引号
string strYearMonth;
int iLotIdStart;
int iLotIdEnd = int.Parse(strLotIdEnd);
if (!isSample)
{
strYearMonth = strLotIdBegin.Substring(0, 5);
iLotIdStart = int.Parse(strLotIdBegin.Substring(5));
}
else
{
strYearMonth = strLotIdBegin.Substring(0, 6);
iLotIdStart = int.Parse(strLotIdBegin.Substring(6));
}
//检测起始和结束批量卡号,让起始批量卡号最小
if (iLotIdStart > iLotIdEnd)
{
int i = iLotIdStart;
iLotIdStart = iLotIdEnd;
iLotIdEnd = i;
}
//批量卡不能太多,不允许超过10张
if (iLotIdEnd - iLotIdStart > 10)
{
//不允许超过10张
throw new Exception(
string.Format(
"您输入批量卡号段 {0} 到 {1}{2} 的批量卡太多,不允许超过10张!",
strLotIdBegin,
strYearMonth,
strLotIdEnd
)
);
}
//.........这里部分代码省略.........
开发者ID:yangdan8,项目名称:ydERPGJ,代码行数:101,代码来源:ProductRecordAdd.aspx.cs
示例19: fvProductNoticeAdd_ItemInserting
protected void fvProductNoticeAdd_ItemInserting(object sender, FormViewInsertEventArgs 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 (canEditHeadRow)
{
//设置录入员姓名和时间
e.Values["add_person"] = Session["user_name"].ToString();
e.Values["add_time"] = DateTime.Now;
e.Values["last_change_time"] = DateTime.Now;
}
//根据输入的内容添加数据
if (InsertData(e))
{
//调用过程执行跳转
fvProductNoticeAdd_ItemInserted(null, null);
}
}
开发者ID:yangdan8,项目名称:ydERPGJ,代码行数:38,代码来源:ProductNoticeAdd.aspx.cs
示例20: fvProcLotCardMgrAdd_ItemInserting
protected void fvProcLotCardMgrAdd_ItemInserting(object sender, FormViewInsertEventArgs e)
{
//默认取消请求
e.Cancel = true;
//检测是否含有session
if (Session.Count < 5)
{
//跳转
Response.Redirect("/Account/Login", true);
//停止加载后续内容
Response.End();
//直接返回
return;
}
//当前用户所在部门
string procName = Session["proc_name"].ToString().ToUpper();
//当前角色id
Int16 roleId = Convert.ToInt16(Session["role_id"]);
//检测是否有权限
if ((procName != mustProcName && procName != "样板") || roleId < 0 || roleId > 1)
{
throw new Exception("您没有添加记录权限!");
}
//当前输入的批量卡序号
string lotId = e.Values["lot_id"].ToString().Trim().ToUpper();
//检测是否样板
bool isSample = lotId.Contains("S");
//检测是否正确批量卡号
if (!isSample && !ydOperateLotCard.IsLotCardId(ref lotId))
{
//非数字返回失败
throw new Exception("您输入了一个不合格的批量卡号 " + lotId + " !");
}
//检测是否正确样板批量卡号
if (isSample && !ydOperateSampleLotCard.IsSampleLotCardId(ref lotId))
{
//非数字返回失败
throw new Exception("您输入了一个不合格的样板批量卡号 " + lotId + " !");
}
//检测lot卡类型
if (lotId.Contains("S") && procName != "样板")
{
throw new Exception("当前只能录入样板批量卡!");
}
//检测lot卡类型
if (!lotId.Contains("S") && procName != "PMC")
{
throw new Exception("当前只能录入生产板批量卡!");
}
//检测批量卡序号是否存在
if (ydOperateLotCard.IsExistLotId(lotId) || ydOperateSampleLotCard.IsExistSampleLotId(lotId))
{
throw new Exception("当前批量卡号 " + lotId + " 已经存在!");
}
//重新设置批量卡号(可能有添加上年份)
e.Values["lot_id"] = lotId;
//设置录入员姓名和时间
e.Values["add_person"] = Session["user_name"].ToString();
e.Values["add_time"] = DateTime.Now;
e.Values["last_change_time"] = DateTime.Now;
//根据输入的批量卡id执行添加数据
if (InsertData(e))
{
//调用过程执行跳转
fvProcLotCardMgrAdd_ItemInserted(null, null);
}
}
开发者ID:yangdan8,项目名称:ydERPGJ,代码行数:67,代码来源:ProcLotCardMgrAdd.aspx.cs
注:本文中的System.Web.UI.WebControls.FormViewInsertEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论