public void jsonFormatTable(IUimDataContext dataContext, ArrayList prelistTable) { ArrayList listRow = new ArrayList(); foreach (object table in prelistTable) { //MessageBox.Show("START FOR LOOP TABLE"); IUimTableSectionContext tablecontext = dataContext.FindTableSection(table.ToString()); // MessageBox.Show("TABLE NAME:" +table.ToString()); // MessageBox.Show("Count Row:" +tablecontext.RowCount.ToString()); string[] column = tablecontext.GetFieldNames(); foreach (string c in column) { //MessageBox.Show("START FOR COLUMN"); //MessageBox.Show("TABLE:"+table.ToString()+ "COLUMN :"+c); for (int i = 0; i < tablecontext.RowCount; i++) { IUimFieldDataContext datafield = tablecontext.GetFieldAt(i, c); string value = datafield.ValueAsString; listRow.Add(value); } string jsonformat = JsonConvert.SerializeObject(listRow); listRow.Clear(); string hname = c.Substring(2); hiddenfield = dataContext.FindFieldDataContext(hname); hiddenfield.SetValue(jsonformat); //MessageBox.Show("TABLE NAME =" +table.ToString()); //MessageBox.Show("Set Field Hidden =" + hname); //MessageBox.Show("VALUE =" +jsonformat); } } }
public void InsertRow(IUimTableSectionContext tableContext, int rowIndex) { string fname = tableContext.GetFieldNames()[0]; //MessageBox.Show("START Insert row fname = "+fname ); IUimFieldDataContext x = tableContext.GetFieldAt(rowIndex, fname); x.SetValue(wform.fundName); wform.fundName = string.Empty; }
public void parseValueDropdown(IUimFormControlContext controlContext, IUimDataEntryFormContext form, string fieldName, int step) { //Step 1 Simple value = code //Step 2 Province select get Text and keep value //Step 3 Simple value = text //Step 4 Empty IUimDataContext datacontext = form.UimDataContext; string fnamedropdown = controlContext.ControlName; // System.Windows.MessageBox.Show("Name Control " +fnamedropdown); try { if (fnamedropdown == fieldName) { // System.Windows.MessageBox.Show("START PARSE VALUE DDL"); string value = form.FindControl(fieldName).ChoiceValue; string text = form.FindControl(fieldName).Text; //System.Windows.MessageBox.Show(value1); if (step == 1) { IUimFieldDataContext fname = datacontext.FindFieldDataContext(fieldName.Substring(4)); fname.SetValue(value); } else if (step == 2) { IUimFieldDataContext fname = datacontext.FindFieldDataContext(fieldName.Substring(4)); fname.SetValue(text); //System.Windows.MessageBox.Show("Set Field :" + fieldName.Substring(4) + "[VALUE]:" + text); IUimFieldDataContext fname2 = datacontext.FindFieldDataContext(fieldName.Substring(4) + "Code"); fname2.SetValue(value); // System.Windows.MessageBox.Show("Set Field :" + fieldName.Substring(4)+"Code"+ "[VALUE]:" + value); } else if (step == 3) { IUimFieldDataContext fname = datacontext.FindFieldDataContext(fieldName.Substring(4)); fname.SetValue(text); } else if (step == 4) { IUimFieldDataContext fname = datacontext.FindFieldDataContext(fieldName.Substring(4)); fname.SetValue(string.Empty); } } } catch (Exception e) { System.Windows.MessageBox.Show(e.ToString()); } }
public void parseValueEmpty(IUimDataEntryFormContext form, string fieldName) { IUimDataContext datacontext = form.UimDataContext; try { IUimFieldDataContext fname = datacontext.FindFieldDataContext(fieldName.Substring(4)); fname.SetValue(string.Empty); } catch (Exception e) { System.Windows.MessageBox.Show(e.ToString()); } }
/// <summary> /// /// </summary> /// <param name="tableContext"></param> /// <param name="rowIndex"></param> public void InsertRow(IUimTableSectionContext tableContext, int rowIndex) { try { string fname = tableContext.GetFieldNames()[0]; //MessageBox.Show("START Insert row fname = "+fname ); IUimFieldDataContext x = tableContext.GetFieldAt(rowIndex, fname); x.SetValue(wform.fundName); wform.fundName = string.Empty; } catch (Exception e) { string error = e.StackTrace.ToString(); } }
public void jsonFormat(IUimDataContext dataContext, ArrayList prelist) { ArrayList list = new ArrayList(); IUimFieldDataContext[] checkbox = dataContext.GetFieldDataContextArray(); foreach (IUimFieldDataContext cb in checkbox) { foreach (object s in prelist) { if (cb.Name.StartsWith(s.ToString())) { list.Add(cb.Name); } } } ArrayList list2 = new ArrayList(); string fieldname = null; foreach (object fname in list) { IUimFieldDataContext field; string[] value = fname.ToString().Split(new string[] { "_S_", "_M_" }, StringSplitOptions.None); string select_value = value[1]; field = dataContext.FindFieldDataContext(fname.ToString()); string hname = value[0]; hiddenfield = dataContext.FindFieldDataContext(hname); if (fieldname != hname) { list2.Clear(); } if (field.Value.ToString() == "1") { if (hname == "bankTransferSelected") { list2.Add(select_value); string jsonresult = JsonConvert.SerializeObject(list2); hiddenfield.SetValue(jsonresult); fieldname = hname; } else { list2.Add(select_value); string jsonresult = JsonConvert.SerializeObject(list2); hiddenfield.SetValue(jsonresult); fieldname = hname; } } else { if (hname == "bankTransferSelected") { list2.Add("N"); string jsonresult = JsonConvert.SerializeObject(list2); hiddenfield.SetValue(jsonresult); fieldname = hname; } } } }