private void UpdateRecord(int dispatchid, int AgentId, int EmpId, int traydispatched, int returntrays, int salesmanid, int routeid, string date, int excesstrays, int shorttrays) { int result = 0; BAgentwiseTray bagentwisetray = new BAgentwiseTray(); result = bagentwisetray.AddAgentwiseTrayDetails(dispatchid, AgentId, EmpId, traydispatched, returntrays, salesmanid, routeid, date, excesstrays, shorttrays); if (result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Agentwise Tray Details Updated Successfully"; pnlError.Update(); upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
public void GetAgentwiseTrayDetails(int DispatchId, string DDate) { bat = new BAgentwiseTray(); DataSet DS = new DataSet(); DS = bat.GetAgentwiseTrayDetails(DispatchId, DDate); if (!Comman.Comman.IsDataSetEmpty(DS)) { if (DS.Tables[0].Rows.Count != 0) { //DataTable dtAll = new DataTable(); //dtAll = DS.Tables[0].Copy(); //dtAll.Merge(DS.Tables[1], true); rpAgentwiseTrayInfo.DataSource = DS; rpAgentwiseTrayInfo.DataBind(); foreach (RepeaterItem item in rpAgentwiseTrayInfo.Items) { tdt.Text = DS.Tables[0].Rows[0]["TraysDispached"].ToString(); trt.Text = DS.Tables[0].Rows[0]["TraysReturned"].ToString(); TextBox textmt = item.FindControl("txtTraysDispached") as TextBox; TraysInfo.Visible = true; } } else { this.BindRepeater(dt); TraysInfo.Visible = false; } } else { this.BindRepeater(dt); TraysInfo.Visible = false; } }