Example #1
0
 protected void initcontrol()
 {
     for (int i = 0; i < dtparam.Rows.Count; i++)
     {
         string     FieldNm   = dtparam.Rows[i]["FIELDNM"].ToString();
         string     FieldType = dtparam.Rows[i]["FIELDTYPE"].ToString();
         string     FieldReff = dtparam.Rows[i]["FIELDREFF"].ToString();
         WebControl oCtrl     = (WebControl)TableInput.FindControl(FieldNm);
         if (FieldType == "auto")
         {
             oCtrl.BorderStyle = BorderStyle.None;
         }
         else
         {
             staticFramework.retrieveschema(dtparamschema, FieldNm, oCtrl);
         }
         if (oCtrl is DevExpress.Web.ASPxComboBox)
         {
             reffcascade((DevExpress.Web.ASPxComboBox)oCtrl, FieldReff);
         }
     }
 }
Example #2
0
        public void retrievepending(string TemporaryID)
        {
            DataTable dtretrieve = conn.GetDataTable(
                sqlpending1 + " AND Y.TEMPORARYID=@1"
                , new object[] { TemporaryID }, dbtimeout);

            for (int i = 0; i < dtparam.Rows.Count; i++)
            {
                string FieldNm   = dtparam.Rows[i]["FIELDNM"].ToString();
                string FieldReff = dtparam.Rows[i]["FIELDREFF"].ToString();
                bool   FieldKey  = false;
                if (dtparam.Rows[i]["FIELDKEY"].ToString() != "")
                {
                    FieldKey = (bool)dtparam.Rows[i]["FIELDKEY"];
                }
                bool   isAuto = dtparam.Rows[i]["FIELDAUTO"].ToString().Trim() != "";
                string AutoPrefix = "", AutoSufix = "";
                if (dtparamschema.Columns[FieldNm].DataType.ToString() == "System.String" &&                //autoprefix and autosuffix must not be used to a non string fieldtype
                    isAuto == false && FieldReff == "")                                                     //and non-auto and non refferential field
                {
                    AutoPrefix = dtparam.Rows[i]["AUTOPREFIX"].ToString();
                    AutoSufix  = dtparam.Rows[i]["AUTOSUFIX"].ToString();
                }
                bool locked = false;
                if (dtparam.Rows[i]["LOCKED"].ToString() != "")
                {
                    locked = (bool)dtparam.Rows[i]["LOCKED"];
                }

                WebControl oCtrl = (WebControl)TableInput.FindControl(FieldNm);
                if (oCtrl is ASPxComboBox)
                {
                    reffcascade((ASPxComboBox)oCtrl, FieldReff);
                }
                if (AutoPrefix.Length > 0 || AutoSufix.Length > 0)
                {
                    string value = null;
                    if (dtretrieve.Rows.Count > 0)
                    {
                        value = dtretrieve.Rows[0][FieldNm].ToString();
                    }
                    if (value.Length > AutoPrefix.Length + AutoSufix.Length)
                    {
                        value = value.Substring(AutoPrefix.Length, value.Length - AutoSufix.Length - AutoPrefix.Length);
                    }
                    staticFramework.retrieve(value, oCtrl);
                }
                else
                {
                    staticFramework.retrieve(dtretrieve, FieldNm, oCtrl);
                }

                if (FieldKey)
                {
                    HtmlInputHidden hCtrl = (HtmlInputHidden)TableInput.FindControl("h_" + FieldNm);
                    staticFramework.retrieve(dtretrieve, FieldNm, hCtrl);
                }

                if (locked)
                {
                    HtmlInputHidden lCtrl = (HtmlInputHidden)TableInput.FindControl("l_" + FieldNm);
                    staticFramework.retrieve(dtretrieve, FieldNm, lCtrl);
                }
            }
        }