예제 #1
0
        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);
                }
            }
        }
        /// <summary>
        /// Executes when the Document is first loaded for the task by the Extraction
        /// module, after all of the runtime setup is complete.
        ///</summary>
        /// <param name="dataContext">The context object for the document.</param>
        public void FormLoad(IUimDataEntryFormContext form)
        {
            try
            {
                IUimDataContext      dataContext = form.UimDataContext;
                IUimFieldDataContext hidden      = dataContext.FindFieldDataContext("hiddenCOMMONS");
                ScriptMain           m           = new ScriptMain();
                m.hiddenSection(form, hidden.ValueAsString);
                prelist = m.getLabelField(form);
                //Custom Table
                prelistTable = m.getLabelTable(form);


                //set Dropdowmn
                List <ScriptMain.LookupDropDownsBankName> listBank = m.restDropDownBankName(dataContext, "BANKMASTER");
                m.setDropdownBankName(form, listBank, "ddl_changeICP_bankName");

                List <ScriptMain.LookupDropDownsProvince> listProvince = m.restDropDownProvince(dataContext, "PROVINCEMASTER");
                //
                m.setDropdownProvince(form, listProvince, "ddl_changeAddress_province");  //ddl_Province ??
            }
            catch (Exception e)
            {
                string error = e.StackTrace;
            }
        }
예제 #3
0
        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;
        }
예제 #4
0
        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());
            }
        }
예제 #5
0
        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());
            }
        }
예제 #6
0
        /// <summary>
        /// Executes when the Document is first loaded for the task by the Extraction
        /// module, after all of the runtime setup is complete.
        ///</summary>
        /// <param name="dataContext">The context object for the document.</param>
        public void FormLoad(IUimDataEntryFormContext form)
        {
            IUimDataContext      dataContext = form.UimDataContext;
            IUimFieldDataContext hidden      = dataContext.FindFieldDataContext("hiddenCOMMONS");
            ScriptMain           m           = new ScriptMain();

            m.hiddenSection(form, hidden.ValueAsString);


            List <ScriptMain.LookupDropDownsBankName> list = m.restDropDownBankName(dataContext, "BANKMASTER");

            m.setDropdownBankName(form, list, "ddl_bankName");
            //ddl_bankName
        }
예제 #7
0
 /// <summary>
 /// Executes when the Document is first loaded for the task by the Extraction
 /// module, after all of the runtime setup is complete.
 ///</summary>
 /// <param name="dataContext">The context object for the document.</param>
 public void FormLoad(IUimDataEntryFormContext form)
 {
     try
     {
         IUimDataContext      dataContext = form.UimDataContext;
         IUimFieldDataContext hidden      = dataContext.FindFieldDataContext("hiddenCOMMONS");
         ScriptMain           m           = new ScriptMain();
         m.hiddenSection(form, hidden.ValueAsString);
         prelist = m.getLabelField(form);
     }
     catch (Exception e)
     {
         string error = e.StackTrace;
     }
 }
예제 #8
0
        /// <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();
            }
        }
예제 #9
0
        /// <summary>
        /// Executes when the Document is first loaded for the task by the Extraction
        /// module, after all of the runtime setup is complete.
        ///</summary>
        /// <param name="dataContext">The context object for the document.</param>
        public void FormLoad(IUimDataEntryFormContext form)
        {
            try
            {
                IUimDataContext      dataContext = form.UimDataContext;
                IUimFieldDataContext hidden      = dataContext.FindFieldDataContext("hiddenCOMMONS");
                ScriptMain           m           = new ScriptMain();
                m.hiddenSection(form, hidden.ValueAsString);
                prelist = m.getLabelField(form);
                //Lookup parameter

                List <ScriptMain.LookupDropDownsBankName> list = m.restDropDownBankName(dataContext, "BANKMASTER");
                m.setDropdownBankName(form, list, "ddl_bankName");
                //ddl_bankName
            }
            catch (Exception e)
            {
                string error = e.StackTrace;
            }
        }
예제 #10
0
        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;
                    }
                }
            }
        }