Exemplo n.º 1
0
        public int delete(int id)
        {
            AbstractCommonData entity   = new UsersReplyEntity();
            string             delQuery = "delete from" + entity.TableName + " where " + entity.IndexFieldName + "=" + provider.getSQLString(id);

            return(provider.delete(delQuery));
        }
Exemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            UsersReplyEntity entity = new UsersReplyEntity();
            DataRow          dr     = entity.Tables[entity.TableName].NewRow();

            dr[UsersReplyEntity.FIELD_ID]           = _id;
            dr[UsersReplyEntity.FIELD_USERID]       = _userId;
            dr[UsersReplyEntity.FIELD_LETTERID]     = _letterId;
            dr[UsersReplyEntity.FIELD_RESPONSEDATE] = DateTime.Now;
            dr[UsersReplyEntity.FIELD_DESCRIPTION]  = txtDescription.Text;

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

            if (_mode.Equals(Constants.ADD_MODE))
            {
                _id         = _usersReplyBL.add(entity);
                lblMsg.Text = "دخیره گردید";
                _mode       = Constants.EDIT_MODE;
                this.Close();
            }
            else
            {
                _usersReplyBL.update(entity);
                lblMsg.Text = "تغییرات به روز رسانی گردید";
            }
        }
Exemplo n.º 3
0
        public UsersReplyEntity getById(int id)
        {
            UsersReplyEntity entity = new UsersReplyEntity();
            string           cond   = UsersReplyEntity.FIELD_ID + "=" + provider.getSQLString(id);

            provider.loadToDataSet(entity, cond);
            return(entity);
        }
Exemplo n.º 4
0
        public UsersReplyEntity get(int letterid)
        {
            UsersReplyEntity entity = new UsersReplyEntity();
            string           cond   = UsersReplyEntity.FIELD_LETTERID + "=" + provider.getSQLString(letterid);

            provider.loadToDataSet(entity, cond);
            return(entity);
        }
Exemplo n.º 5
0
        public int finalizeReply(int letterid, int userid)
        {
            AbstractCommonData entity = new UsersReplyEntity();
            string             update = "UPDATE " + entity.TableName + " SET " + UsersReplyEntity.FIELD_FINALIZED + "=" +
                                        provider.getSQLString(true)
                                        + "  WHERE " + UsersReplyEntity.FIELD_LETTERID + "=" + provider.getSQLString(letterid) + " AND " +
                                        UsersReplyEntity.FIELD_USERID + "=" + provider.getSQLString(userid);

            return(provider.delete(update));
        }
Exemplo n.º 6
0
        public UsersReplyForm(int id)
        {
            _id = id;
            InitializeComponent();

            _usersReplyBL = new UsersRelpyBL();
            _mode         = Constants.EDIT_MODE;

            UsersReplyEntity entity = _usersReplyBL.getById(_id);

            _userId              = int.Parse(entity.get(UsersReplyEntity.FIELD_USERID).ToString());
            _letterId            = int.Parse(entity.get(UsersReplyEntity.FIELD_LETTERID).ToString());
            txtRegisterDate.Text = RMX_TOOLS.date.DateXFormer.gregorianToPersianString((DateTime)
                                                                                       entity.get(UsersReplyEntity.FIELD_RESPONSEDATE));
            txtDescription.Text = entity.get(UsersReplyEntity.FIELD_DESCRIPTION).ToString();
        }
Exemplo n.º 7
0
 public int update(UsersReplyEntity entity)
 {
     return(provider.update(entity));
 }
Exemplo n.º 8
0
 public int add(UsersReplyEntity entity)
 {
     return(provider.add(entity));
 }
Exemplo n.º 9
0
 public int update(UsersReplyEntity entity)
 {
     return(((UsersReplyDA)_abstractDA).update(entity));
 }
Exemplo n.º 10
0
 public int add(UsersReplyEntity entity)
 {
     return(((UsersReplyDA)_abstractDA).add(entity));
 }