protected void Button1_Click1(object sender, EventArgs e) { int id = Convert.ToInt32(txtticketid.Text); Hashtable data = new Hashtable(); bll compview = new bll(); data = compview.selcomp(id); txtticket_id .Text = data["ticket_id"].ToString(); txtclientname.Text = data["client_id"].ToString(); txtcustomername.Text = data["cc_id"].ToString(); txtempreg.Text = data["emp_reg"].ToString(); txtdoc.Text = data["docomplain"].ToString(); //txtempassigned.Text = data["emp_assess"].ToString(); txtprobtype.Text = data["probtype"].ToString(); txtprobsubtype.Text = data["probsubtype"].ToString(); txtpriority.Text = data["priority"].ToString(); cbstatus.SelectedItem.Text = data["ticket_status"].ToString(); txtdorepair.Text = data["dorepair"].ToString(); txtxtaskdesc.Text = data["taskdesc"].ToString(); txtothers.Text = data["others"].ToString(); txtassetid.Text = data["assetid"].ToString(); commaDelimited = data["fullstring"].ToString(); string[] year = commaDelimited.Split(new char[] { ',' }); foreach (string month in year) { d[k] = month; k++; } TabContainer1.Visible = true; }
protected override void OnInit(EventArgs e) { base.OnInit(e); int id = Convert.ToInt32(Session["ticketid"]); int id1; id1 = Convert.ToInt32(Session["clientid"]); Hashtable dataforvalue = new Hashtable(); bll compview = new bll(); if (id != 0) { dataforvalue = compview.selcomp(id); commaDelimited = dataforvalue["fullstring"].ToString(); string[] year = commaDelimited.Split(new char[] { ',' }); foreach (string month in year) { d[k] = month; k++; } int a = id1; bll noof = new bll(); int w, z, tn, cn, tc = 0, cc = 0; Hashtable datano = new Hashtable(); datano = noof.noofrows(a); w = Convert.ToInt32(datano["noofrows"]); tn = Convert.ToInt32(datano["nooftxt"]); cn = Convert.ToInt32(datano["noofcb"]); dynamicTextBoxes = new TextBox[tn]; dynamiccombobox = new AjaxControlToolkit.ComboBox[cn]; Table tbl = new Table(); for (z = 0; z < w; z++) { bll cuscontrol = new bll(); Hashtable data = new Hashtable(); data = cuscontrol.ccomp(a, z); TableRow tr = new TableRow(); TableCell td0 = new TableCell(); tr.CssClass = "table_tr"; TableCell td1 = new TableCell(); int field = Convert.ToInt32(data["id"]); if (data["control"].ToString() == "Combobox") { Response.Write(System.Environment.NewLine); lbl = new System.Web.UI.WebControls.Label(); lbl.ID = (2 * z).ToString(); lbl.Text = data["label"].ToString(); lbl.CssClass = "ajxtxt"; td0.Controls.Add(lbl); cb = new AjaxControlToolkit.ComboBox(); cb.ID = (2 * z + 1).ToString(); cb.Enabled = false; cb.CssClass = "ajxtxt"; cb.ForeColor = Color.Black; dynamiccombobox[cc] = cb; cc++; td1.Controls.Add(cb); if (data["value"].ToString() == "get") { string q = data["dbname"].ToString(); bll reff = new bll(); Type t = reff.GetType(); Type[] paramTypes = new Type[1]; paramTypes[0] = Type.GetType("System.Int32"); MethodInfo CosineInfo = t.GetMethod(q, paramTypes); Object[] parameters = new Object[1]; parameters[0] = a; Object returnVal = CosineInfo.Invoke(reff, parameters); string commaDelimited1 = returnVal.ToString(); string[] year1 = commaDelimited1.Split(new char[] { ',' }); foreach (string month1 in year1) { cb.Items.Add(month1); } cb.SelectedItem.Text = d[2 * z + 1]; } else { string returnVal = data["value"].ToString(); string commaDelimited2 = returnVal.ToString(); string[] year2 = commaDelimited2.Split(new char[] { ',' }); foreach (string month2 in year2) { cb.Items.Add(month2); } cb.SelectedItem.Text = d[2 * z + 1]; } tr.Cells.Add(td0); tr.Cells.Add(td1); tbl.Rows.Add(tr); } else { int y = 10; lbl = new System.Web.UI.WebControls.Label(); lbl.ID = (2 * z).ToString(); lbl.Text = data["label"].ToString(); lbl.CssClass = "ajxtxt"; td0.Controls.Add(lbl); TextBox txt = new TextBox(); txt.ID = (2 * z + 1).ToString(); // txt.Text = data["value"].ToString(); txt.Enabled = false; txt.CssClass = "ajxtxt"; txt.Text = d[2 * z + 1]; td1.Controls.Add(txt); dynamicTextBoxes[tc] = txt; tc++; } tr.Cells.Add(td0); tr.Cells.Add(td1); tbl.Rows.Add(tr); } PlaceHolder1.Controls.Add(tbl); } }
protected void LinkButton1_Click(object sender, EventArgs e) { string str; str = Request.QueryString["Ticketid"]; int id = Convert.ToInt32(str); string str1; str1 = Request.QueryString["clientname"]; txtticketid.Text = id.ToString(); txtclientname.Text = str1; Hashtable data = new Hashtable(); bll clemp = new bll(); data=clemp.selcomp(id); txtprobtype.Text = data["probtype"].ToString(); txtprobsubtype.Text = data["probsubtype"].ToString(); txtdocomplain.Text = data["docomplain"].ToString(); txtdorepair.Text = data["dorepair"].ToString(); txtpriority.Text = data["priority"].ToString(); cbstatus .SelectedValue= data["ticket_status"].ToString(); txteta.Text = data["eta"].ToString(); txtata.Text = data["ata"].ToString(); txtatc.Text = data["atc"].ToString(); txtotherdesc.Text = data["others"].ToString(); txttastdesc.Text= data["taskdesc"].ToString(); txtpartdesc.Text = data["partdesc"].ToString(); txtlabourcost.Text = data["labourcost"].ToString(); txtaddcost.Text = data["additionalcost"].ToString(); txtpartcost.Text = data["partscost"].ToString(); txttotal.Text = data["total"].ToString(); txttax.Text = data["tax"].ToString(); txtgrandtotal.Text = data["grandtotal"].ToString(); txtcc.Text = data["cc_id"].ToString(); txtassetid.Text = data["assetid"].ToString(); txtwrkdnehead.Text = data["workdonehead"].ToString(); txtwrkdneshift.Text = data["workdoneshift"].ToString(); txtwrkdnetech.Text = data["workdonetechnician"].ToString(); lblnaemempreg.Text = data["emp_reg"].ToString(); lblnamehead.Text = data["emp_head"].ToString(); lblnameshift .Text =data ["emp_shift"].ToString (); lblnametech.Text = data["emp_technician"].ToString(); txtassetid.Text = data["assetid"].ToString(); Session["assetid"] = txtassetid.Text; Session["emp_technician"] = data["emp_technician"].ToString(); Session["emp_shift"] = data["emp_shift"].ToString(); if (data["partsrequired"].ToString() == "Yes") { rbyespart.Checked=true ; } else if(data["partsrequired"].ToString() == "No") { rbnopart.Checked=true ; } if (data["customerpayment"].ToString() == "Yes") { rbyespayment.Checked=true ; } else if (data["customerpayment"].ToString() == "No") { rbnopayment.Checked=true ; } if (data["emp_shift"].ToString() == "" && Session ["designation"].ToString ()=="Head") { lbshift.Enabled =true ; lbtech.Enabled = false ; } else if (data["emp_shift"].ToString() != "" && Session["designation"].ToString() == "Head") { lbshift.Enabled = true; lbtech.Enabled = false ; } if (data["emp_technician"].ToString() == "" && Session["designation"].ToString() == "Shift engg") { lbshift.Enabled = false ; lbtech.Enabled = true ; } else if (data["emp_technician"].ToString() != "" && Session["designation"].ToString() == "Shift engg") { lbshift.Enabled =false ; lbtech.Enabled = true ; } //if (data["emp_technician"].ToString() != "") //{ // lbtech.Enabled = false; //} //else //{ // lbtech.Enabled = true; //} if (Session["designation"].ToString () == "Head") { txtwrkdnehead.Enabled = true; lblwrkhead.Enabled = true; txtwrkdneshift.Enabled = false ; lblworkshift.Enabled = false ; txtwrkdnetech.Enabled = false ; lblwrktech.Enabled = false; } else if (Session["designation"].ToString () == "Shift engg") { txtwrkdneshift.Enabled = true; lblworkshift.Enabled = true; txtwrkdnetech.Enabled = true; lblwrktech.Enabled = true; txtwrkdnehead.Enabled = false ; lblwrkhead.Enabled = false ; } UpdatePanel2.Visible = true; PlaceHolder1.Visible = false; Session["clientid"] = data["client_id"]; }