Exemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            DialogResult dres = MessageBox.Show("با تغییر رنگ نامه های قبلی نیز به رنگ جدید تغییر می کنند، آیا ادامه می دهید", "", MessageBoxButtons.YesNo);

            if (dres.Equals(DialogResult.No))
            {
                return;
            }


            for (int i = 0; i < cmbLetterStateId.Items.Count; i++)
            {
                ComboBoxItem item = (ComboBoxItem)cmbLetterStateId.Items[i];
                if (item.CustomData != null && item.CustomData.Length > 0)
                {
                    _basicInfoBL.updateCustomData(int.Parse(item.Value.ToString()), item.CustomData);
                }
            }
            ApplicationPropertiesBL appPropertiesBL = new ApplicationPropertiesBL();
            int kk = appPropertiesBL.add(ApplicationPropertiesBL.COLOR_CONFIRMED_LETTER, ColorTranslator.ToHtml(pnlColorConfirmedLetter.BackColor));

            kk = appPropertiesBL.add(ApplicationPropertiesBL.COLOR_REFERENCE_LIMIT, ColorTranslator.ToHtml(pnlReferenceColor.BackColor));
            kk = appPropertiesBL.add(ApplicationPropertiesBL.REFERENCE_COUNT, txtReferLimit.Text);
            kk = appPropertiesBL.add(ApplicationPropertiesBL.CHEQUE_WITHNO_REPLY, ColorTranslator.ToHtml(pnlCheque.BackColor));

            updateLetterColors();
            updateChequeColors();
            lblMsg.Text = "تغییرات دذخیره گردید";
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            SavePrivateSetting();


            _applicationPropertiesBL = new ApplicationPropertiesBL();
            _applicationPropertiesBL.add(ApplicationPropertiesBL.ALARM_LIST_REFRESH_TIME,
                                         cmbScheduleForRefresh.Items[cmbScheduleForRefresh.SelectedIndex].ToString());

            this.Close();
        }
Exemplo n.º 3
0
 private void setAlarmRefreshTime()
 {
     if (RMX_TOOLS.data.Config.provider.connectionStatus)
     {
         ApplicationPropertiesBL app = new ApplicationPropertiesBL();
         string s = app.getValue(ApplicationPropertiesBL.ALARM_LIST_REFRESH_TIME);
         if (s != null && s.Length > 0)
         {
             timer1.Interval = int.Parse(s) * 60 * 1000;
         }
     }
 }
        private void init()
        {
            ApplicationPropertiesBL appPropertiesBL = new ApplicationPropertiesBL();

            txtReferLimit.Text = appPropertiesBL.getValue(ApplicationPropertiesBL.REFERENCE_COUNT);

            txtToDate.Text = RMX_TOOLS.date.DateXFormer.gregorianToPersianString(DateTime.Now);
            DateTime dt = DateTime.Now;

            dt = dt.AddMonths(-1);
            txtFromDate.Text = RMX_TOOLS.date.DateXFormer.gregorianToPersianString(dt);
        }
Exemplo n.º 5
0
        private void init()
        {
            pnlLetterStateColor.BackColor = Color.White;
            BasicInfoUtil.fillComboBox(cmbLetterStateId, "LetterState", -1);

            ApplicationPropertiesBL appPropertiesBL = new ApplicationPropertiesBL();

            pnlColorConfirmedLetter.BackColor = ColorTranslator.FromHtml(appPropertiesBL.getValue(ApplicationPropertiesBL.COLOR_CONFIRMED_LETTER));
            pnlReferenceColor.BackColor       = ColorTranslator.FromHtml(appPropertiesBL.getValue(ApplicationPropertiesBL.COLOR_REFERENCE_LIMIT));
            txtReferLimit.Text  = appPropertiesBL.getValue(ApplicationPropertiesBL.REFERENCE_COUNT);
            pnlCheque.BackColor = ColorTranslator.FromHtml(appPropertiesBL.getValue(ApplicationPropertiesBL.CHEQUE_WITHNO_REPLY));
        }
Exemplo n.º 6
0
        public int updateRefferenceUser(int letterid, int userTreeId)
        {
            if (letterid < 0)
            {
                return(0);
            }
            //
            int referFromUserId = int.Parse(UsersBS.loginedUser.get(UsersEntity.FIELD_ID).ToString());

            ((LetterDA)_abstractDA).updateRefferenceUser(letterid, userTreeId, referFromUserId);

            ReferLetterBL referLetterBL = new ReferLetterBL();
            //Register Refer to referletter table
            int currUserId = int.Parse(UsersBS.loginedUser.get(UsersEntity.FIELD_ID).ToString());
            // کاربری که در درخت قرار دارد را شناسایی کرده و
            // به userTreeUserId الحاق شود
            UserTreeBL userTreeBL = new UserTreeBL();

            UserTreeEntity usertreeEntity = userTreeBL.get(userTreeId);
            int            usertreeUserId = int.Parse(usertreeEntity.get(UserTreeEntity.FIELD_USER_ID).ToString());

            //بررسی برای برگشت ارجاع
            // اگر برگشت باشد ثبت می کند
            checkForReferenceCycle(letterid, currUserId, usertreeUserId);


            ReferLetterEntity entity = new ReferLetterEntity();
            DataRow           dr     = entity.Tables[entity.TableName].NewRow();

            dr[ReferLetterEntity.FIELD_LETTER_ID]       = letterid;
            dr[ReferLetterEntity.FIELD_REFER_DATE]      = DateTime.Now;
            dr[ReferLetterEntity.FIELD_REFER_FROM_USER] = currUserId;
            dr[ReferLetterEntity.FIELD_REFER_TO_USER]   = usertreeUserId;// کاربر در درخت کاربران

            entity.Tables[entity.TableName].Rows.Add(dr);
            referLetterBL.add(entity);

            //check how many reffer occured this letter
            // اگر بیش از حد ارجاع شده باشد رنگ ان را تغییر خواهیم داد
            int refCount = referLetterBL.getReferCount(letterid);
            ApplicationPropertiesBL appProBl = new ApplicationPropertiesBL();
            int masterRefCount = int.Parse(appProBl.getValue(ApplicationPropertiesBL.REFERENCE_COUNT));

            if (refCount >= masterRefCount)
            {
                string refColor = appProBl.getValue(ApplicationPropertiesBL.COLOR_REFERENCE_LIMIT);
                updateRefColor(letterid, refColor);
            }
            return(1);
        }
Exemplo n.º 7
0
        private void checkColorOFCheque()
        {
            ChequeReplyEntity en = _chequeReplyBL.getByCheque(_id, "");

            if (en.Tables[en.FilledTableName].Rows.Count > 0)
            {
                _chequeBL.updateColor(_id, "");
            }
            else
            {
                ApplicationPropertiesBL appPropertiesBL = new ApplicationPropertiesBL();
                string color = appPropertiesBL.getValue(ApplicationPropertiesBL.CHEQUE_WITHNO_REPLY);
                _chequeBL.updateColor(_id, color);
            }
        }