Esempio n. 1
0
        public static string GetSeqListSelected(GridView grvList, string CheckBoxId, int ColSelect, int ColSeq)
        {
            string SeqList = "";

            for (int i = 0, i2 = grvList.Rows.Count; i < i2; i++)
            {
                CheckBox chkSelect = grvList.Rows[i].Cells[ColSelect].FindControl(CheckBoxId) as CheckBox;
                if (chkSelect == null)
                {
                    continue;
                }
                if (!chkSelect.Checked)
                {
                    continue;
                }

                int Seq = CFindRep.IfNotNumberThen0(grvList.Rows[i].Cells[ColSeq].Text);
                if (Seq == 0)
                {
                    continue;
                }

                SeqList += "," + Seq.ToString();
            }
            if (SeqList != "")
            {
                SeqList = SeqList.Substring(1);
            }

            return(SeqList);
        }
Esempio n. 2
0
 public static int GetAttributeInt32(XmlAttribute Attr)
 {
     if (Attr != null)
     {
         return(CFindRep.IfNotNumberThen0(Attr.Value));
     }
     else
     {
         return(0);
     }
 }
Esempio n. 3
0
        public static int GetLinkButtonValue(TableCell cell)
        {
            LinkButton lbt = cell.Controls[0] as LinkButton;

            if (lbt == null)
            {
                return(0);
            }

            return(CFindRep.IfNotNumberThen0(lbt.Text));
        }
Esempio n. 4
0
        public static void SplitToVariable(string ValueList, char Delim,
                                           out string Value1Is, out int Value2Is, out int Value3Is)
        {
            Value1Is = "";
            Value2Is = 0;
            Value3Is = 0;

            string sValue2Is;
            string sValue3Is;
            string sValue4Is;

            SplitToVariable(ValueList, Delim, out Value1Is, out sValue2Is, out sValue3Is, out sValue4Is);

            Value2Is = CFindRep.IfNotNumberThen0(sValue2Is);
            Value3Is = CFindRep.IfNotNumberThen0(sValue3Is);
        }
Esempio n. 5
0
        public static void RestoreListControlSelectedIndex(string AppProductName, ContainerControl FrmOrUc, ListControl lst, CXmlConfig xc)
        {
            string FrmOrUcName = FrmOrUc.Name;
            string Section     = AppProductName + "\\" + FrmOrUcName;
            string ControlName = lst.Name;

            int SelectedIndex =
                (xc != null) ?
                CFindRep.IfNotNumberThen0(xc.GetSetting(FrmOrUcName + "." + ControlName, lst.SelectedIndex)) :
                CFindRep.IfNotNumberThen0(CRegistry.GetSetting(Section, ControlName, lst.SelectedIndex));

            if (lst.SelectedIndex != SelectedIndex)
            {
                //Items.Count 읽을 수 없어 try 사용.
                try { lst.SelectedIndex = SelectedIndex; }
                catch (Exception) { }
            }
        }
Esempio n. 6
0
        private static Version GetVersion(XmlDocument XDoc)
        {
            XmlAttribute Attr = XDoc.DocumentElement.Attributes["FileVersion"];

            if (Attr == null)
            {
                return(new Version());
            }

            int Version = CFindRep.IfNotNumberThen0(Attr.Value);

            if (Version > 0)
            {
                //4255 -> 4.2.5.5
                string[] aVersion = CArray.SplitByLength(Attr.Value, 1);
                return(new Version(Convert.ToInt32(aVersion[0]), Convert.ToInt32(aVersion[1]), Convert.ToInt32(aVersion[2]), Convert.ToInt32(aVersion[3])));
            }
            else
            {
                return(new Version(Attr.Value));
            }
        }
Esempio n. 7
0
 public static int ColumnInt32(ComboBox cbo, object Column)
 {
     return(CFindRep.IfNotNumberThen0(CRowSource.Column(cbo, Column)));
 }