예제 #1
0
        public bool GetDelete(int ID)
        {
            M_UserBaseField fieldMod = GetSelect(ID);

            DBCenter.Del(TbName, PK, ID);
            new B_ModelField().DelField("ZL_UserBase", fieldMod.FieldName);
            return(true);
        }
예제 #2
0
        private void InitFileExtArr()
        {
            string content   = "";
            string fieldType = "";

            if (ModelID > 0)
            {
                B_ModelField bmf = new B_ModelField();
                M_ModelField mmf = bmf.GetModelByFieldName(ModelID, FieldName);
                mmf       = (mmf == null) ? new M_ModelField() : mmf;
                content   = mmf.Content;
                fieldType = mmf.FieldType;
            }
            else
            {
                B_UserBaseField bubf = new B_UserBaseField();
                M_UserBaseField mubf = bubf.getUserBaseFieldByFieldName(FieldName);
                mubf      = (mubf == null) ? new M_UserBaseField() : mubf;
                content   = mubf.Content;
                fieldType = mubf.FieldType;
            }
            if (content != null)
            {
                string[] Setting = content.Split(new char[] { ',' });
                if (fieldType == "PicType")
                {
                    this.m_MaxFileSize            = DataConverter.CLng(Setting[1].Split(new char[] { '=' })[1]);
                    this.ViewState["MaxFileSize"] = Setting[1].Split(new char[] { '=' })[1];
                    this.m_FileExtArr             = Setting[2].Split(new char[] { '=' })[1];
                    this.ViewState["FileExtArr"]  = Setting[2].Split(new char[] { '=' })[1];
                    this.ViewState["UploadType"]  = "PicType";
                }
                if (fieldType == "FileType")
                {
                    string chkSize   = Setting[0].Split(new char[] { '=' })[1];
                    string SizeField = Setting[1].Split(new char[] { '=' })[1];
                    this.ViewState["SizeField"]   = SizeField;
                    this.m_MaxFileSize            = DataConverter.CLng(Setting[2].Split(new char[] { '=' })[1]);
                    this.ViewState["MaxFileSize"] = Setting[2].Split(new char[] { '=' })[1];
                    this.m_FileExtArr             = Setting[3].Split(new char[] { '=' })[1];
                    this.ViewState["FileExtArr"]  = Setting[3].Split(new char[] { '=' })[1];
                    this.ViewState["UploadType"]  = "FileType";
                }

                if (fieldType == "SmallFileType")
                {
                    string chkSize   = Setting[0].Split(new char[] { '=' })[1];
                    string SizeField = Setting[1].Split(new char[] { '=' })[1];
                    this.ViewState["SizeField"]   = SizeField;
                    this.m_MaxFileSize            = DataConverter.CLng(chkSize);
                    this.ViewState["MaxFileSize"] = chkSize;
                    this.m_FileExtArr             = SizeField;
                    this.ViewState["FileExtArr"]  = SizeField;
                    this.ViewState["UploadType"]  = "SmallFileType";
                }
            }
        }
예제 #3
0
 public bool InsertUpdate(M_UserBaseField model)
 {
     if (model.FieldID > 0)
     {
         return(GetUpdate(model));
     }
     else
     {
         return(GetInsert(model) > 0);
     }
 }
        protected void Repeater1_ItemCommand(object sender, RepeaterCommandEventArgs e)
        {
            //上移
            if (e.CommandName == "UpMove")
            {
                int             Id       = DataConverter.CLng(e.CommandArgument);
                M_UserBaseField mubf     = this.bbf.GetSelect(Id);
                M_UserBaseField FieldPre = this.bbf.GetPreField(mubf.OrderId);

                if (mubf.OrderId != FieldPre.OrderId)
                {
                    int CurrOrder = mubf.OrderId;
                    mubf.OrderId     = FieldPre.OrderId;
                    FieldPre.OrderId = CurrOrder;
                    this.bbf.GetUpdate(mubf);
                    this.bbf.GetUpdate(FieldPre);
                }
            }
            //下移
            if (e.CommandName == "DownMove")
            {
                int             Id        = DataConverter.CLng(e.CommandArgument);
                M_UserBaseField mubf      = this.bbf.GetSelect(Id);
                M_UserBaseField FieldNext = this.bbf.GetNextField(mubf.OrderId);
                if (mubf.OrderId != FieldNext.OrderId)
                {
                    int CurrOrder = mubf.OrderId;
                    mubf.OrderId      = FieldNext.OrderId;
                    FieldNext.OrderId = CurrOrder;
                    this.bbf.GetUpdate(mubf);
                    this.bbf.GetUpdate(FieldNext);
                }
            }
            //删除
            if (e.CommandName == "Delete")
            {
                int Id = DataConverter.CLng(e.CommandArgument);
                bbf.GetDelete(Id);
            }
            MyBind();
        }
예제 #5
0
 public bool GetUpdate(M_UserBaseField model)
 {
     return(DBCenter.UpdateByID(model, model.FieldID));;
 }
예제 #6
0
 public int GetInsert(M_UserBaseField model)
 {
     return(DBCenter.Insert(model));
 }