Exemple #1
0
        public void UpdateMUF(string muid, string action)
        {
            try
            {
                BaseBll bll = new BaseBll();
                if (action == "add")
                {
                    tstmnumuf muf = new tstmnumuf();
                    muf.apnm = Parameter.APPLICATION_NAME;
                    muf.muid = muid.Trim();
                    muf.urid = Function.GetCurrentUser();
                    muf.adtm = DateTime.Now;

                    bll.DoInsert <tstmnumuf>(muf);
                }

                if (action == "delete")
                {
                    List <ColumnInfo> parameters = new List <ColumnInfo>()
                    {
                        new ColumnInfo()
                        {
                            ColumnName = "muid", ColumnValue = muid
                        },
                        new ColumnInfo()
                        {
                            ColumnName = "apnm", ColumnValue = Parameter.APPLICATION_NAME
                        },
                        new ColumnInfo()
                        {
                            ColumnName = "urid", ColumnValue = Function.GetCurrentUser()
                        }
                    };

                    tstmnumuf obj = bll.GetSelectedObject <tstmnumuf>(parameters);
                    if (obj != null)
                    {
                        //bll.DoDelete<tstmnumuf>(parameters);
                        bll.DoDelete <tstmnumuf>(obj);
                    }
                }
            }
            catch (UtilException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new UtilException(ex.Message, ex);
            }
        }