本文整理汇总了C#中System.Web.UI.UpdatePanel.Update方法的典型用法代码示例。如果您正苦于以下问题:C# UpdatePanel.Update方法的具体用法?C# UpdatePanel.Update怎么用?C# UpdatePanel.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.UpdatePanel
的用法示例。
在下文中一共展示了UpdatePanel.Update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: unitNoChanged
protected void unitNoChanged(GridView gv, UpdatePanel uppanel, int rowIndex)
{
try
{
foreach (GridViewRow item in gv.Rows)
{
int Index = item.DataItemIndex;
if (Index == rowIndex)
{
TextBox txtDescription = (TextBox)item.FindControl("txtDescription");
TextBox txtUnitNo = (TextBox)item.FindControl("txtUnitNo");
TextBox txtAPP = (TextBox)item.FindControl("txtAPP");
Label lblTotalAmount = (Label)item.FindControl("lblTotalAmount");
if (txtUnitNo.Text != "" && txtAPP.Text != "")
{
lblTotalAmount.Text = (decimal.Parse(txtUnitNo.Text) * decimal.Parse(txtAPP.Text)).ToString();
uppanel.Update();
}
}
}
//findTotalAmount();
}
catch
{
}
finally
{
uppanel.Update();
}
}
示例2: AddArrival
protected void AddArrival(GridView gv, UpdatePanel uppanel)
{
int count = gv.Rows.Count;
int count1 = count + 1;
DataTable dt = new DataTable();
foreach (GridViewRow item in gv.Rows)
{
TextBox txtFlightname = (TextBox)item.FindControl("txtFlightName");
RadTimePicker txttime = (RadTimePicker)item.FindControl("rdtpTime");
TextBox txtNoOfPassenger = (TextBox)item.FindControl("txtNoOfPassenger");
TextBox txtdate = (TextBox)item.FindControl("txtFlightDate");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("Flightname");
dt.Columns.Add("Time");
dt.Columns.Add("NoOfPassenger");
dt.Columns.Add("Date");
}
DataRow dr = dt.NewRow();
dr["Flightname"] = txtFlightname.Text;
dr["Time"] = txttime.SelectedDate;
dr["NoOfPassenger"] = txtNoOfPassenger.Text;
dr["Date"] = txtdate.Text;
dt.Rows.Add(dr);
}
if (count == 0)
{
if (dt.Columns.Count == 0)
{
dt.Columns.Add("Flightname");
dt.Columns.Add("Time");
dt.Columns.Add("NoOfPassenger");
dt.Columns.Add("Date");
}
DataRow dr = dt.NewRow();
dr["Flightname"] = "";
dr["Time"] = "";
dr["NoOfPassenger"] = "";
dr["Date"] = "";
dt.Rows.Add(dr);
gv.DataSource = dt;
gv.DataBind();
uppanel.Update();
}
if (count != 0)
{
DataRow dr1 = dt.NewRow();
dt.Rows.Add(dr1);
}
gv.DataSource = dt;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
TextBox txtFlightname = (TextBox)item.FindControl("txtFlightName");
RadTimePicker txttime = (RadTimePicker)item.FindControl("rdtpTime");
TextBox txtNoOfPassenger = (TextBox)item.FindControl("txtNoOfPassenger");
TextBox txtdate = (TextBox)item.FindControl("txtFlightDate");
for (int k = 0; k < dt.Rows.Count; k++)
{
if (itm == k)
{
txtFlightname.Text = dt.Rows[itm]["Flightname"].ToString();
if (dt.Rows[itm]["Time"].ToString() != "")
{
txttime.SelectedDate = DateTime.Parse(dt.Rows[itm]["Time"].ToString());
}
txtNoOfPassenger.Text = dt.Rows[itm]["NoOfPassenger"].ToString();
txtdate.Text = dt.Rows[itm]["Date"].ToString();
}
}
}
uppanel.Update();
}
示例3: HotelValidation
protected void HotelValidation(GridView gv_Hotel, UpdatePanel upPanel)
{
DropDownList hotel = new DropDownList();
DropDownList roomtype = new DropDownList();
hotel = (DropDownList)gv_Hotel.Rows[0].FindControl("drpHotelName");
roomtype = (DropDownList)gv_Hotel.Rows[0].FindControl("drpRoomType");
DropDownList hotel0 = new DropDownList();
DropDownList roomtype0 = new DropDownList();
try
{
for (int i = 0; i < gv_Hotel.Rows.Count; i++)
{
hotel = (DropDownList)gv_Hotel.Rows[i].FindControl("drpHotelName");
roomtype = (DropDownList)gv_Hotel.Rows[i].FindControl("drpRoomType");
for (int j = 1; j < gv_Hotel.Rows.Count; j++)
{
hotel0 = (DropDownList)gv_Hotel.Rows[j].FindControl("drpHotelName");
roomtype0 = (DropDownList)gv_Hotel.Rows[j].FindControl("drpRoomType");
if ((hotel0.Text == hotel.Text) && (roomtype0.Text == roomtype.Text) && (i != j))
{
roomtype0.Text = "";
Master.DisplayMessage("Hotel Not Allowed Same Room Type.", "successMessage", 5000);
}
}
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
upPanel.Update();
}
}
示例4: AddDescription
protected void AddDescription(GridView gv, UpdatePanel uppanel)
{
try
{
int count = gv.Rows.Count;
int count1 = count + 1;
DataTable dt = new DataTable();
foreach (GridViewRow item in gv.Rows)
{
TextBox txtDescription = (TextBox)item.FindControl("txtDescription");
TextBox txtUnitNo = (TextBox)item.FindControl("txtUnitNo");
TextBox txtAPP = (TextBox)item.FindControl("txtAPP");
Label lblDeatilsID = (Label)item.FindControl("lblDeatilsID");
Label lblTotalAmount = (Label)item.FindControl("lblTotalAmount");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("Description");
dt.Columns.Add("UnitNo");
dt.Columns.Add("AmountPerPerson");
dt.Columns.Add("TotalAmount");
dt.Columns.Add("DetailID");
}
DataRow dr = dt.NewRow();
dr["Description"] = txtDescription.Text;
dr["UnitNo"] = txtUnitNo.Text;
dr["AmountPerPerson"] = txtAPP.Text;
dr["TotalAmount"] = lblTotalAmount.Text;
dr["DetailID"] = lblDeatilsID.Text;
dt.Rows.Add(dr);
}
if (count == 0)
{
if (dt.Columns.Count == 0)
{
dt.Columns.Add("Description");
dt.Columns.Add("UnitNo");
dt.Columns.Add("AmountPerPerson");
dt.Columns.Add("TotalAmount");
dt.Columns.Add("DetailID");
}
DataRow dr = dt.NewRow();
dr["Description"] = "";
dr["UnitNo"] = "";
dr["AmountPerPerson"] = "";
dr["TotalAmount"] = "";
dr["DetailID"] = "";
dt.Rows.Add(dr);
gv.DataSource = dt;
gv.DataBind();
uppanel.Update();
}
if (count != 0)
{
DataRow dr1 = dt.NewRow();
dt.Rows.Add(dr1);
}
gv.DataSource = dt;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
TextBox txtDescription = (TextBox)item.FindControl("txtDescription");
TextBox txtUnitNo = (TextBox)item.FindControl("txtUnitNo");
TextBox txtAPP = (TextBox)item.FindControl("txtAPP");
Button btnHotelRemove = (Button)item.FindControl("btnHotelRemove");
Label lblDeatilsID = (Label)item.FindControl("lblDeatilsID");
Label lblTotalAmount = (Label)item.FindControl("lblTotalAmount");
if (ViewState["RowCount"] != null)
{
if (itm <= int.Parse(ViewState["RowCount"].ToString()))
{
btnHotelRemove.Visible = false;
}
else
{
}
}
for (int k = 0; k < dt.Rows.Count; k++)
{
if (itm == k)
//.........这里部分代码省略.........
示例5: AddHotels
protected void AddHotels(GridView gv, string CityName, UpdatePanel uppanel)
{
try
{
int count = gv.Rows.Count;
int count1 = count + 1;
DataTable dt = new DataTable();
DataSet ds = objGitDetail.fetchComboDataforHotel("FETCH_HOTEL_NAME_FOR_GIT_CITY_WISE", CityName);
foreach (GridViewRow item in gv.Rows)
{
DropDownList drpHotelName = (DropDownList)item.FindControl("drpHotelName");
DropDownList drpRoomType = (DropDownList)item.FindControl("drpRoomType");
TextBox txtCheckInDate = (TextBox)item.FindControl("txtCheckInDate");
TextBox txtCheckOutDate = (TextBox)item.FindControl("txtCheckOutDate");
TextBox txtNights = (TextBox)item.FindControl("txtNights");
CheckBox chk = (CheckBox)item.FindControl("chkAddToCart");
TextBox txtSingleRoom = (TextBox)item.FindControl("txtSingleRoom");
TextBox txtDoubleRoom = (TextBox)item.FindControl("txtDoubleRoom");
TextBox txtTripleRoom = (TextBox)item.FindControl("txtTripleRoom");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("HotelName");
dt.Columns.Add("RoomType");
dt.Columns.Add("CheckInDate");
dt.Columns.Add("CheckOutDate");
dt.Columns.Add("Nights");
dt.Columns.Add("AddCart");
dt.Columns.Add("SingleRoom");
dt.Columns.Add("DoubleRoom");
dt.Columns.Add("TripleRoom");
}
DataRow dr = dt.NewRow();
dr["HotelName"] = drpHotelName.Text;
dr["RoomType"] = drpRoomType.Text;
dr["CheckInDate"] = txtCheckInDate.Text;
dr["CheckOutDate"] = txtCheckOutDate.Text;
dr["Nights"] = txtNights.Text;
dr["SingleRoom"] = txtSingleRoom.Text;
dr["DoubleRoom"] = txtDoubleRoom.Text;
dr["TripleRoom"] = txtTripleRoom.Text;
if (chk.Checked)
{
dr["AddCart"] = "True";
}
else
{
dr["AddCart"] = "False";
}
dt.Rows.Add(dr);
}
if (count == 0)
{
if (dt.Columns.Count == 0)
{
dt.Columns.Add("HotelName");
dt.Columns.Add("RoomType");
dt.Columns.Add("CheckInDate");
dt.Columns.Add("CheckOutDate");
dt.Columns.Add("Nights");
dt.Columns.Add("AddCart");
dt.Columns.Add("SingleRoom");
dt.Columns.Add("DoubleRoom");
dt.Columns.Add("TripleRoom");
}
DataRow dr = dt.NewRow();
dr["HotelName"] = "";
dr["RoomType"] = "";
dr["CheckInDate"] = "";
dr["CheckOutDate"] = "";
dr["Nights"] = "";
dr["AddCart"] = "";
dr["SingleRoom"] = "";
dr["DoubleRoom"] = "";
dr["TripleRoom"] = "";
dt.Rows.Add(dr);
gv.DataSource = dt;
gv.DataBind();
uppanel.Update();
}
if (count != 0)
{
DataRow dr1 = dt.NewRow();
dt.Rows.Add(dr1);
}
gv.DataSource = dt;
gv.DataBind();
//.........这里部分代码省略.........
示例6: addServices
protected void addServices(GridView gv, UpdatePanel uppanel)
{
try
{
int count = gv.Rows.Count;
int count1 = count + 1;
DataTable dt = new DataTable();
foreach (GridViewRow item in gv.Rows)
{
TextBox txtServices = (TextBox)item.FindControl("txtServices");
TextBox txtDate = (TextBox)item.FindControl("txtDate");
TextBox txtNoPax = (TextBox)item.FindControl("txtNoPax");
DropDownList drpSupplier = (DropDownList)item.FindControl("drpSupplier");
TextBox txtNetPrice = (TextBox)item.FindControl("txtNetPrice");
TextBox txtSellPrice = (TextBox)item.FindControl("txtSellPrice");
TextBox txtFrom = (TextBox)item.FindControl("txtFrom");
TextBox txtTo = (TextBox)item.FindControl("txtTo");
TextBox txtPassenger = (TextBox)item.FindControl("txtNoOfPassanger");
CheckBox chkaditional = (CheckBox)item.FindControl("chkAditional");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("Seriveces");
dt.Columns.Add("Date");
dt.Columns.Add("NoPax");
dt.Columns.Add("Supplier");
dt.Columns.Add("NetPrice");
dt.Columns.Add("SellPrice");
dt.Columns.Add("From");
dt.Columns.Add("To");
dt.Columns.Add("NoOfPassanger");
dt.Columns.Add("chkAditional");
}
DataRow dr = dt.NewRow();
dr["Seriveces"] = txtServices.Text;
dr["Date"] = txtDate.Text;
dr["NoPax"] = txtNoPax.Text;
dr["Supplier"] = drpSupplier.Text;
dr["NetPrice"] = txtNetPrice.Text;
dr["SellPrice"] = txtSellPrice.Text;
dr["From"] = txtFrom.Text;
dr["To"] = txtTo.Text;
dr["NoOfPassanger"] = txtPassenger.Text;
dr["chkAditional"] = chkaditional.Checked;
dt.Rows.Add(dr);
}
if (count == 0)
{
if (dt.Columns.Count == 0)
{
dt.Columns.Add("Seriveces");
dt.Columns.Add("Date");
dt.Columns.Add("NoPax");
dt.Columns.Add("Supplier");
dt.Columns.Add("NetPrice");
dt.Columns.Add("SellPrice");
dt.Columns.Add("From");
dt.Columns.Add("To");
dt.Columns.Add("NoOfPassanger");
dt.Columns.Add("chkAditional");
}
DataRow dr = dt.NewRow();
dr["Seriveces"] = "";
dr["Date"] = "";
dr["NoPax"] = "";
dr["Supplier"] = "";
dr["NetPrice"] = "";
dr["SellPrice"] = "";
dr["From"] = "";
dr["To"] = "";
dr["NoOfPassanger"] = "";
dr["chkAditional"] = "";
dt.Rows.Add(dr);
gv.DataSource = dt;
gv.DataBind();
uppanel.Update();
}
if (count != 0)
{
DataRow dr1 = dt.NewRow();
dt.Rows.Add(dr1);
}
gv.DataSource = dt;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
//.........这里部分代码省略.........
示例7: removeRow
protected void removeRow(GridView gv, int rowIndex, UpdatePanel uppanel)
{
try
{
DataTable dt = new DataTable();
DataTable dt1 = new DataTable();
int count = gv.Rows.Count;
for (int i = 0; i < count - 1; i++)
{
dt1.Rows.Add();
}
foreach (GridViewRow item in gv.Rows)
{
DropDownList drpInvoiceNo = (DropDownList)item.FindControl("drpInvoiceNo");
Label lblAmount = (Label)item.FindControl("lblTotalAmount");
TextBox txtSettleAmount = (TextBox)item.FindControl("txtSettledAmount");
TextBox txtInvoiceAmount = (TextBox)item.FindControl("txtInvoiceAmount");
Label lblRemaingBalance = (Label)item.FindControl("lblRemaingBalance");
Label lblAmountSettled = (Label)item.FindControl("lblAmountSettled");
//Label lblRemaingBalance = (Label)item.FindControl("lblRemaingBalance");
//Label lblAmountValidate = (Label)item.FindControl("lblAmountValidate");
TextBox txtInvoiceAmountTHB = (TextBox)item.FindControl("txtInvoiceAmountTHB");
Label lblTourName = (Label)item.FindControl("lblTourName");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("InvoiceNo");
dt.Columns.Add("Amount");
dt.Columns.Add("SettleAmount");
dt.Columns.Add("InvoiceAmount");
dt.Columns.Add("lblRemaingBalance");
dt.Columns.Add("lblAmountSettled");
//dt.Columns.Add("RemainingAmount");
//dt.Columns.Add("ValidateAmount");
dt.Columns.Add("InvoiceAmountTHB");
dt.Columns.Add("TourName");
}
DataRow dr = dt.NewRow();
dr["InvoiceNo"] = drpInvoiceNo.Text;
dr["Amount"] = lblAmount.Text;
dr["SettleAmount"] = txtSettleAmount.Text;
dr["InvoiceAmount"] = txtInvoiceAmount.Text;
// dr["RemainingAmount"] = lblRemaingBalance.Text;
//dr["ValidateAmount"] = lblAmountValidate.Text;
dr["lblRemaingBalance"] = "";
dr["lblAmountSettled"] = "";
dr["InvoiceAmountTHB"] = txtInvoiceAmountTHB.Text;
dr["TourName"] = lblTourName.Text;
dt.Rows.Add(dr);
}
gv.DataSource = dt1;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
int itm1 = item.DataItemIndex;
if (itm >= rowIndex)
{
itm = itm + 1;
}
DropDownList drpInvoiceNo = (DropDownList)item.FindControl("drpInvoiceNo");
Label lblAmount = (Label)item.FindControl("lblTotalAmount");
TextBox txtSettleAmount = (TextBox)item.FindControl("txtSettledAmount");
TextBox txtInvoiceAmount = (TextBox)item.FindControl("txtInvoiceAmount");
Label lblRemaingBalance = (Label)item.FindControl("lblRemaingBalance");
Label lblAmountSettled = (Label)item.FindControl("lblAmountSettled");
//Label lblRemaingBalance = (Label)item.FindControl("lblRemaingBalance");
//Label lblAmountValidate = (Label)item.FindControl("lblAmountValidate");
TextBox txtInvoiceAmountTHB = (TextBox)item.FindControl("txtInvoiceAmountTHB");
Label lblTourName = (Label)item.FindControl("lblTourName");
Button btnHotelRemove = (Button)item.FindControl("btnHotelRemove");
if (ViewState["RowCount"] != null)
{
if (itm <= int.Parse(ViewState["RowCount"].ToString()))
{
btnHotelRemove.Visible = false;
}
else
{
}
}
bindInvoiceFromSupplier(itm1);
//.........这里部分代码省略.........
示例8: RemoveGalaDinner
protected void RemoveGalaDinner(GridView gv, string CityName, UpdatePanel uppanel, int rowIndex)
{
DataTable dt = new DataTable();
DataTable dt1 = new DataTable();
int count = gv.Rows.Count;
for (int i = 0; i < count - 1; i++)
{
dt1.Rows.Add();
}
DataSet ds = objGitDetail.fetchConfGala("GET_GALA_DINNER_HOTEL", CityName);
foreach (GridViewRow item in gv.Rows)
{
CheckBox chkGala = (CheckBox)item.FindControl("chkGala");
TextBox txtDate = (TextBox)item.FindControl("txtDate");
DropDownList drpGalaType = (DropDownList)item.FindControl("drpGalaType");
DropDownList drpHotel = (DropDownList)item.FindControl("drpHotel");
TextBox txtchildRate = (TextBox)item.FindControl("txtChildRate");
TextBox txtadultRate = (TextBox)item.FindControl("txtAdultRate");
TextBox txtReconfirmedDate = (TextBox)item.FindControl("txtReconfirmedDate");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("Date");
dt.Columns.Add("GalaType");
dt.Columns.Add("Hotel");
dt.Columns.Add("AddCart");
dt.Columns.Add("ChildRate");
dt.Columns.Add("AdultRate");
dt.Columns.Add("ReconfirmedDate");
}
DataRow dr = dt.NewRow();
dr["Date"] = txtDate.Text;
dr["GalaType"] = drpGalaType.Text;
dr["Hotel"] = drpHotel.Text;
dr["ChildRate"] = txtchildRate.Text;
dr["AdultRate"] = txtadultRate.Text;
dr["ReconfirmedDate"] = txtReconfirmedDate.Text;
if (chkGala.Checked)
{
dr["AddCart"] = "True";
}
else
{
dr["AddCart"] = "False";
}
dt.Rows.Add(dr);
}
gv.DataSource = dt1;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
if (itm >= rowIndex)
{
itm = itm + 1;
}
CheckBox chkGala = (CheckBox)item.FindControl("chkGala");
TextBox txtDate = (TextBox)item.FindControl("txtDate");
DropDownList drpGalaType = (DropDownList)item.FindControl("drpGalaType");
DropDownList drpHotel = (DropDownList)item.FindControl("drpHotel");
TextBox txtchildRate = (TextBox)item.FindControl("txtChildRate");
TextBox txtadultRate = (TextBox)item.FindControl("txtAdultRate");
TextBox txtReconfirmedDate = (TextBox)item.FindControl("txtReconfirmedDate");
for (int k = 0; k < dt.Rows.Count; k++)
{
if (itm == k)
{
binddropdownlist(drpHotel, ds);
drpHotel.Text = dt.Rows[itm]["Hotel"].ToString();
if (Request["TOURID"] != null && !string.IsNullOrEmpty(Request["TOURID"].ToString()))
{
if (drpHotel.Text != "")
{
DataSet dsGalaType = objGitDetail.CommonSp("GET_GALA_DINNER_TYPE");
binddropdownlist(drpGalaType, dsGalaType);
drpGalaType.Text = dt.Rows[itm]["GalaType"].ToString();
}
}
else
{
DataSet dsGalaType = objGitDetail.CommonSp("GET_GALA_DINNER_TYPE");
binddropdownlist(drpGalaType, dsGalaType);
//.........这里部分代码省略.........
示例9: fillHotelsEditMode
protected void fillHotelsEditMode(GridView gv, UpdatePanel uppanel)
{
try
{
DataSet ds = objVouchersStoredProcedure.get_records_for_edit("GET_EDIT_RECEIPT_VOUCHER_DETAILS", Request["VN"].ToString());
for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
{
if (ds.Tables[0].Rows[j]["INVOICE_NO"].ToString() != "")
{
foreach (GridViewRow item in gv.Rows)
{
if (j == item.DataItemIndex + 1)
{
DropDownList drpinvoice = (DropDownList)item.FindControl("drpinvoice");
Label lblAmountTHB = (Label)item.FindControl("lblAmountTHB");
TextBox txtAmountSettled = (TextBox)item.FindControl("txtAmountSettled");
Label lblBalancetobepaid = (Label)item.FindControl("lblBalancetobepaid");
Label lblDetailId = (Label)item.FindControl("lblDetailId");
Label lblOldAmount = (Label)item.FindControl("lblOldAmount");
Label lblAmountUSD = (Label)item.FindControl("lblAmountUSD");
Label lblStatus = (Label)item.FindControl("lblStatus");
lblDetailId.Text = ds.Tables[0].Rows[j]["SALES_RECEIPT_VOUCHER_DETAIL_ID"].ToString();
drpinvoice.Text = ds.Tables[0].Rows[j]["INVOICE_NO"].ToString();
DataSet ds1 = objVouchersStoredProcedure.fetch_invoice_dateials("FETCH_DESCRIPTION_FROM_INVOICE_NO_USD", drpinvoice.Text);
lblAmountTHB.Text = ds1.Tables[0].Rows[0]["VOUCHER_AMOUNT"].ToString();
lblAmountUSD.Text = ds1.Tables[0].Rows[0]["INVOICE_AMOUNT"].ToString();
lblStatus.Text = ds1.Tables[0].Rows[0]["ORDER_STATUS_NAME"].ToString();
txtAmountSettled.Text = ds.Tables[0].Rows[j]["DETAILS_FOREX"].ToString();
lblBalancetobepaid.Text = get_balance_be_paid(ds1.Tables[0].Rows[0]["total_amount"].ToString(), drpinvoice.Text);
lblOldAmount.Text = (decimal.Parse(lblBalancetobepaid.Text) + decimal.Parse(txtAmountSettled.Text)).ToString();
}
}
if (j < ds.Tables[0].Rows.Count - 1)
{
AddReceipt(gv, uppanel);
}
}
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
uppanel.Update();
}
}
示例10: AddReceipt
protected void AddReceipt(GridView gv, UpdatePanel uppanel)
{
try
{
int count = gv.Rows.Count;
int count1 = count + 1;
DataTable dt = new DataTable();
foreach (GridViewRow item in gv.Rows)
{
DropDownList drpinvoice = (DropDownList)item.FindControl("drpinvoice");
Label lblAmountTHB = (Label)item.FindControl("lblAmountTHB");
TextBox txtAmountSettled = (TextBox)item.FindControl("txtAmountSettled");
Label lblBalancetobepaid = (Label)item.FindControl("lblBalancetobepaid");
Label lblDetailId = (Label)item.FindControl("lblDetailId");
Label lblOldAmount = (Label)item.FindControl("lblOldAmount");
Label lblStatus = (Label)item.FindControl("lblStatus");
Label lblAmountUSD = (Label)item.FindControl("lblAmountUSD");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("InvoiceNo");
dt.Columns.Add("Amount");
dt.Columns.Add("AmountSattled");
dt.Columns.Add("Baltobepaid");
dt.Columns.Add("DetailId");
dt.Columns.Add("lblOldAmount");
dt.Columns.Add("lblAmountUSD");
dt.Columns.Add("lblStatus");
}
DataRow dr = dt.NewRow();
dr["InvoiceNo"] = drpinvoice.Text;
dr["Amount"] = lblAmountTHB.Text;
dr["AmountSattled"] = txtAmountSettled.Text;
dr["Baltobepaid"] = lblBalancetobepaid.Text;
dr["DetailId"] = lblDetailId.Text;
dr["lblOldAmount"] = lblOldAmount.Text;
dr["lblAmountUSD"] = lblAmountUSD.Text;
dr["lblStatus"] = lblStatus.Text;
dt.Rows.Add(dr);
}
if (count == 0)
{
if (dt.Columns.Count == 0)
{
dt.Columns.Add("InvoiceNo");
dt.Columns.Add("Amount");
dt.Columns.Add("AmountSattled");
dt.Columns.Add("Baltobepaid");
dt.Columns.Add("DetailId");
dt.Columns.Add("lblOldAmount");
dt.Columns.Add("lblAmountUSD");
dt.Columns.Add("lblStatus");
}
DataRow dr = dt.NewRow();
dr["InvoiceNo"] = "";
dr["Amount"] = "";
dr["AmountSattled"] = "";
dr["Baltobepaid"] = "";
dr["DetailId"] = "";
dr["lblOldAmount"] = "";
dr["lblAmountUSD"] = "";
dr["lblStatus"] = "";
dt.Rows.Add(dr);
gv.DataSource = dt;
gv.DataBind();
uppanel.Update();
}
if (count != 0)
{
DataRow dr1 = dt.NewRow();
dt.Rows.Add(dr1);
}
gv.DataSource = dt;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
DropDownList drpinvoice = (DropDownList)item.FindControl("drpinvoice");
Label lblAmountTHB = (Label)item.FindControl("lblAmountTHB");
TextBox txtAmountSettled = (TextBox)item.FindControl("txtAmountSettled");
Label lblBalancetobepaid = (Label)item.FindControl("lblBalancetobepaid");
Label lblDetailId = (Label)item.FindControl("lblDetailId");
Label lblOldAmount = (Label)item.FindControl("lblOldAmount");
//.........这里部分代码省略.........
示例11: BoatremoveRow
protected void BoatremoveRow(GridView gv, int rowIndex, UpdatePanel uppanel)
{
try
{
DataTable dt = new DataTable();
DataTable dt1 = new DataTable();
int count = gv.Rows.Count;
for (int i = 0; i < count - 1; i++)
{
dt1.Rows.Add();
}
foreach (GridViewRow item in gv.Rows)
{
if (rowIndex != item.DataItemIndex)
{
Label txtPackagename = (Label)item.FindControl("lblPackName");
TextBox txtNoofBoats = (TextBox)item.FindControl("txtBoats");
DropDownList drpsupplier = (DropDownList)item.FindControl("drpSupplier");
TextBox txtdate = (TextBox)item.FindControl("txtDate");
RadTimePicker txttime = (RadTimePicker)item.FindControl("rdtpTime");
Label lblPackid = (Label)item.FindControl("lblPackid");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("GIT_TRANSFER_PACKGE_NAME");
dt.Columns.Add("NoofBoats");
dt.Columns.Add("Supplier");
dt.Columns.Add("Date");
dt.Columns.Add("Time");
dt.Columns.Add("Id");
}
DataRow dr = dt.NewRow();
dr["GIT_TRANSFER_PACKGE_NAME"] = txtPackagename.Text;
dr["NoofBoats"] = txtNoofBoats.Text;
dr["Supplier"] = drpsupplier.Text;
dr["Date"] = txtdate.Text;
dr["Time"] = txttime.SelectedDate;
dr["Id"] = lblPackid.Text;
dt.Rows.Add(dr);
}
}
gv.DataSource = dt1;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
if (itm >= rowIndex)
{
itm = itm + 1;
}
for (int k = 0; k < dt.Rows.Count; k++)
{
if (itm == k)
{
Label txtPackagename = (Label)item.FindControl("lblPackName");
TextBox txtNoofBoats = (TextBox)item.FindControl("txtBoats");
DropDownList drpsupplier = (DropDownList)item.FindControl("drpSupplier");
TextBox txtdate = (TextBox)item.FindControl("txtDate");
RadTimePicker txttime = (RadTimePicker)item.FindControl("rdtpTime");
fillBoatSupplier(gridBoat, itm);
txtPackagename.Text = dt.Rows[0]["GIT_TRANSFER_PACKGE_NAME"].ToString();
txtNoofBoats.Text = dt.Rows[itm]["NoofBoats"].ToString();
drpsupplier.Text = dt.Rows[itm]["Supplier"].ToString();
txtdate.Text = dt.Rows[itm]["Date"].ToString();
if (dt.Rows[itm]["Time"].ToString() != "")
{
txttime.SelectedDate = DateTime.Parse(dt.Rows[itm]["Time"].ToString());
}
}
}
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
uppanel.Update();
}
}
示例12: AddBoat
protected void AddBoat(GridView gv, UpdatePanel uppanel)
{
int count = gv.Rows.Count;
int count1 = count + 1;
DataTable dt = new DataTable();
foreach (GridViewRow item in gv.Rows)
{
Label txtPackagename = (Label)item.FindControl("lblPackName");
TextBox txtNoofBoats = (TextBox)item.FindControl("txtBoats");
DropDownList drpsupplier = (DropDownList)item.FindControl("drpSupplier");
TextBox txtdate = (TextBox)item.FindControl("txtDate");
RadTimePicker txttime = (RadTimePicker)item.FindControl("rdtpTime");
Label lblPackid = (Label)item.FindControl("lblPackid");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("GIT_TRANSFER_PACKGE_NAME");
dt.Columns.Add("NoofBoats");
dt.Columns.Add("Supplier");
dt.Columns.Add("Date");
dt.Columns.Add("Time");
dt.Columns.Add("Id");
}
DataRow dr = dt.NewRow();
dr["GIT_TRANSFER_PACKGE_NAME"] = txtPackagename.Text;
dr["NoofBoats"] = txtNoofBoats.Text;
dr["Supplier"] = drpsupplier.Text;
dr["Date"] = txtdate.Text;
dr["Time"] = txttime.SelectedDate;
dr["Id"] = lblPackid.Text;
dt.Rows.Add(dr);
}
if (count == 0)
{
if (dt.Columns.Count == 0)
{
dt.Columns.Add("GIT_TRANSFER_PACKGE_NAME");
dt.Columns.Add("NoofBoats");
dt.Columns.Add("Supplier");
dt.Columns.Add("Date");
dt.Columns.Add("Time");
dt.Columns.Add("Id");
}
DataRow dr = dt.NewRow();
dr["GIT_TRANSFER_PACKGE_NAME"] = "";
dr["NoofBoats"] = "";
dr["Supplier"] = "";
dr["Date"] = "";
dr["Time"] = "";
dr["Id"] = "0";
dt.Rows.Add(dr);
gv.DataSource = dt;
gv.DataBind();
uppanel.Update();
}
if (count != 0)
{
DataRow dr1 = dt.NewRow();
dr1["Id"] = "0";
dt.Rows.Add(dr1);
}
gv.DataSource = dt;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
Label txtPackagename = (Label)item.FindControl("lblPackName");
TextBox txtNoofBoats = (TextBox)item.FindControl("txtBoats");
DropDownList drpsupplier = (DropDownList)item.FindControl("drpSupplier");
TextBox txtdate = (TextBox)item.FindControl("txtDate");
RadTimePicker txttime = (RadTimePicker)item.FindControl("rdtpTime");
for (int k = 0; k < dt.Rows.Count; k++)
{
if (itm == k)
{
fillBoatSupplier(gridBoat, itm);
txtPackagename.Text = dt.Rows[0]["GIT_TRANSFER_PACKGE_NAME"].ToString();
txtNoofBoats.Text = dt.Rows[itm]["NoofBoats"].ToString();
drpsupplier.Text = dt.Rows[itm]["Supplier"].ToString();
txtdate.Text = dt.Rows[itm]["Date"].ToString();
if (dt.Rows[itm]["Time"].ToString() != "")
{
txttime.SelectedDate = DateTime.Parse(dt.Rows[itm]["Time"].ToString());
}
//.........这里部分代码省略.........
示例13: AddGuide
protected void AddGuide(GridView gv, UpdatePanel uppanel)
{
int count = gv.Rows.Count;
int count1 = count + 1;
DataTable dt = new DataTable();
foreach (GridViewRow item in gv.Rows)
{
Label txtPackagename = (Label)item.FindControl("lblPackName");
TextBox txtNoofNights = (TextBox)item.FindControl("txtNights");
TextBox txtNoofGuides = (TextBox)item.FindControl("txtGuides");
DropDownList drpsupplier = (DropDownList)item.FindControl("drpSupplier");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("GIT_TRANSFER_PACKGE_NAME");
dt.Columns.Add("NoofNights");
dt.Columns.Add("NoofGuides");
dt.Columns.Add("Supplier");
}
DataRow dr = dt.NewRow();
dr["GIT_TRANSFER_PACKGE_NAME"] = txtPackagename.Text;
dr["NoofNights"] = txtNoofNights.Text;
dr["NoofGuides"] = txtNoofGuides.Text;
dr["Supplier"] = drpsupplier.Text;
dt.Rows.Add(dr);
}
if (count == 0)
{
if (dt.Columns.Count == 0)
{
dt.Columns.Add("GIT_TRANSFER_PACKGE_NAME");
dt.Columns.Add("NoofNights");
dt.Columns.Add("NoofGuides");
dt.Columns.Add("Supplier");
}
DataRow dr = dt.NewRow();
dr["GIT_TRANSFER_PACKGE_NAME"] = "";
dr["NoofNights"] = "";
dr["NoofGuides"] = "";
dr["Supplier"] = "";
dt.Rows.Add(dr);
gv.DataSource = dt;
gv.DataBind();
uppanel.Update();
}
if (count != 0)
{
DataRow dr1 = dt.NewRow();
dt.Rows.Add(dr1);
}
gv.DataSource = dt;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
Label txtPackagename = (Label)item.FindControl("lblPackName");
TextBox txtNoofNights = (TextBox)item.FindControl("txtNights");
TextBox txtNoofGuides = (TextBox)item.FindControl("txtGuides");
DropDownList drpsupplier = (DropDownList)item.FindControl("drpSupplier");
for (int k = 0; k < dt.Rows.Count; k++)
{
if (itm == k)
{
fillGuideSupplier(gridGuide);
txtPackagename.Text = dt.Rows[0]["GIT_TRANSFER_PACKGE_NAME"].ToString();
txtNoofNights.Text = dt.Rows[itm]["NoofNights"].ToString();
txtNoofGuides.Text = dt.Rows[itm]["NoofGuides"].ToString();
drpsupplier.Text = dt.Rows[itm]["Supplier"].ToString();
}
}
}
uppanel.Update();
}
示例14: RemoveConference
protected void RemoveConference(GridView gv, string CityName, UpdatePanel uppanel, int rowIndex)
{
try
{
DataTable dt = new DataTable();
DataTable dt1 = new DataTable();
int count = gv.Rows.Count;
for (int i = 0; i < count - 1; i++)
{
dt1.Rows.Add();
}
DataSet ds = objGitDetail.fetchConfGala("GET_CONFERENCE_HOTEL", CityName);
foreach (GridViewRow item in gv.Rows)
{
CheckBox chk = (CheckBox)item.FindControl("chkConf");
TextBox txtDate = (TextBox)item.FindControl("txtDate");
DropDownList drpConfType = (DropDownList)item.FindControl("drpConfType");
DropDownList drpHotel = (DropDownList)item.FindControl("drpHotel");
TextBox txtchildRate = (TextBox)item.FindControl("txtChildRate");
TextBox txtadultRate = (TextBox)item.FindControl("txtAdultRate");
RadTimePicker txttime = (RadTimePicker)item.FindControl("rdtpTime");
TextBox txtReconfirmedDate = (TextBox)item.FindControl("txtReconfirmedDate");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("Date");
dt.Columns.Add("ConferenceType");
dt.Columns.Add("Hotel");
dt.Columns.Add("AddCart");
dt.Columns.Add("ChildRate");
dt.Columns.Add("AdultRate");
dt.Columns.Add("Time");
dt.Columns.Add("ReconfirmedDate");
}
DataRow dr = dt.NewRow();
dr["Date"] = txtDate.Text;
dr["ConferenceType"] = drpConfType.Text;
dr["Hotel"] = drpHotel.Text;
dr["ChildRate"] = txtchildRate.Text;
dr["AdultRate"] = txtadultRate.Text;
dr["Time"] = txttime.SelectedDate;
dr["ReconfirmedDate"] = txtReconfirmedDate.Text;
if (chk.Checked)
{
dr["AddCart"] = "True";
}
else
{
dr["AddCart"] = "False";
}
dt.Rows.Add(dr);
}
gv.DataSource = dt1;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
if (itm >= rowIndex)
{
itm = itm + 1;
}
CheckBox chk = (CheckBox)item.FindControl("chkConf");
TextBox txtDate = (TextBox)item.FindControl("txtDate");
DropDownList drpConfType = (DropDownList)item.FindControl("drpConfType");
DropDownList drpHotel = (DropDownList)item.FindControl("drpHotel");
TextBox txtchildRate = (TextBox)item.FindControl("txtChildRate");
TextBox txtadultRate = (TextBox)item.FindControl("txtAdultRate");
RadTimePicker txttime = (RadTimePicker)item.FindControl("rdtpTime");
TextBox txtReconfirmedDate = (TextBox)item.FindControl("txtReconfirmedDate");
for (int k = 0; k < dt.Rows.Count; k++)
{
if (itm == k)
{
binddropdownlist(drpHotel, ds);
drpHotel.Text = dt.Rows[itm]["Hotel"].ToString();
if (Request["TOURID"] != null && !string.IsNullOrEmpty(Request["TOURID"].ToString()))
{
if (drpHotel.Text != "")
{
DataSet ds_ConfType = objGitDetail.CommonSp("GET_CONFERENCE_TYPE");
binddropdownlist(drpConfType, ds_ConfType);
//.........这里部分代码省略.........
示例15: AddTime
protected void AddTime(GridView gv, UpdatePanel uppanel)
{
int count = gv.Rows.Count;
int count1 = count + 1;
DataTable dt = new DataTable();
foreach (GridViewRow item in gv.Rows)
{
Label lblfrom = (Label)item.FindControl("lblFrom");
Label lblto = (Label)item.FindControl("lblTo");
DropDownList drptime = (DropDownList)item.FindControl("drpTime");
if (dt.Columns.Count == 0)
{
dt.Columns.Add("FROM_NAME");
dt.Columns.Add("TO_NAME");
dt.Columns.Add("TIME");
}
DataRow dr = dt.NewRow();
dr["FROM_NAME"] = lblfrom.Text;
dr["TO_NAME"] = lblto.Text;
dr["TIME"] = drptime.Text;
dt.Rows.Add(dr);
}
if (count == 0)
{
if (dt.Columns.Count == 0)
{
dt.Columns.Add("FROM_NAME");
dt.Columns.Add("TO_NAME");
dt.Columns.Add("TIME");
}
DataRow dr = dt.NewRow();
dr["FROM_NAME"] = "";
dr["TO_NAME"] = "";
dr["TIME"] = "";
dt.Rows.Add(dr);
gv.DataSource = dt;
gv.DataBind();
uppanel.Update();
}
if (count != 0)
{
DataRow dr1 = dt.NewRow();
dt.Rows.Add(dr1);
}
gv.DataSource = dt;
gv.DataBind();
foreach (GridViewRow item in gv.Rows)
{
int itm = item.DataItemIndex;
Label lblfrom = (Label)item.FindControl("lblFrom");
Label lblto = (Label)item.FindControl("lblTo");
DropDownList drptime = (DropDownList)item.FindControl("drpTime");
for (int k = 0; k < dt.Rows.Count; k++)
{
if (itm == k)
{
DataSet ds = objTransferPackageTimeMapping.fetchComboData("FETCH_ALL_TRANSFER_PACKAGE_TIMING");
binddropdownlist(drptime, ds);
lblfrom.Text = dt.Rows[0]["FROM_NAME"].ToString();
lblto.Text = dt.Rows[0]["TO_NAME"].ToString();
drptime.Text = dt.Rows[itm]["TIME"].ToString();
}
}
}
uppanel.Update();
}