Esempio n. 1
0
        public void initForm(int letterid)
        {
            ReferLetterBL     refLetterBl = new ReferLetterBL();
            ReferLetterEntity entity      = refLetterBl.get(letterid);

            //_letterBl.get(LetterType);

            System.Collections.Hashtable hash = new Hashtable();
            hash.Add("colorField", "COLOR");

            //_gridTools.bindDataToGrid(dataGridView1, entity, new GridTools.changingRow(_gridTools.changeColor), hash);
            _gridTools.bindDataToGrid(dataGridView1, entity, null, hash);
        }
        private string getUsers(int letterid)
        {
            string            retStr          = "";
            ReferLetterEntity refLetterEntity = _referLetterBL.get(letterid);

            if (refLetterEntity.RowCount() <= 0)
            {
                return("");
            }

            string fromName = "";
            string toName   = "";
            string date     = "";

            UsersEntity usersEntity = null;

            for (int i = 0; i < refLetterEntity.RowCount(); i++)
            {
                date = RMX_TOOLS.date.DateXFormer.gregorianToPersianString((DateTime)
                                                                           refLetterEntity.get(i, ReferLetterEntity.FIELD_REFER_DATE));


                if (refLetterEntity.get(i, ReferLetterEntity.FIELD_REFER_FROM_USER).ToString().Length > 0)
                {
                    int id = int.Parse(refLetterEntity.get(i, ReferLetterEntity.FIELD_REFER_FROM_USER).ToString());
                    usersEntity = _usersBL.get(id);
                    fromName    = usersEntity.ToString();
                }
                if (refLetterEntity.get(i, ReferLetterEntity.FIELD_REFER_TO_USER).ToString().Length > 0)
                {
                    int id = int.Parse(refLetterEntity.get(i, ReferLetterEntity.FIELD_REFER_TO_USER).ToString());
                    usersEntity = _usersBL.get(id);
                    toName      = usersEntity.ToString();
                }

                retStr += "[" + (i + 1) + "-" + date + " " + " از " + fromName + " به " + toName + "]";
            }
            return(retStr);
        }