private bool DoEdit(int _id) { bool result = true; BLL.link bll = new BLL.link(); Model.link model = bll.GetModel(_id); model.title = txtTitle.Text.Trim(); model.is_lock = int.Parse(rblIsLock.SelectedValue); model.is_red = int.Parse(rblIsRed.SelectedValue); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.user_name = txtUserName.Text.Trim(); model.user_tel = txtUserTel.Text.Trim(); model.email = txtEmail.Text.Trim(); model.site_url = txtSiteUrl.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.is_image = 1; if (string.IsNullOrEmpty(model.img_url)) { model.is_image = 0; } if (!bll.Update(model)) { result = false; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.link bll = new BLL.link(); Model.link model = bll.GetModel(_id); model.site_path = ddlSitePath.SelectedValue; model.title = txtTitle.Text.Trim(); model.is_lock = Utils.StrToInt(rblIsLock.SelectedValue, 0); if (cbIsRed.Checked == true) { model.is_red = 1; } else { model.is_red = 0; } model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99); model.user_name = txtUserName.Text.Trim(); model.user_tel = txtUserTel.Text.Trim(); model.email = txtEmail.Text.Trim(); model.site_url = txtSiteUrl.Text.Trim(); model.is_image = 1; if (string.IsNullOrEmpty(model.img_url)) { model.is_image = 0; } //判断上传图片 if (this.imgUpload.HasFile) { //上传前先删除原图片 if (!string.IsNullOrEmpty(model.img_url)) { Utils.DeleteFile(model.img_url); } DTcms.Model.upLoad upfile = new Web.UI.UpLoad().fileSaveAs(this.imgUpload.PostedFile, 0, false, false); if (upfile.status > 0) { model.img_url = upfile.path; } } else { //判断是否需要删除原图 if (txtImgUrl.Text.Trim() == "" && !string.IsNullOrEmpty(model.img_url)) { Utils.DeleteFile(model.img_url); } model.img_url = txtImgUrl.Text.Trim(); } if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改友情链接:" + model.title); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.link bll = new BLL.link(); Model.link model = bll.GetModel(_id); model.site_path = ddlSitePath.SelectedValue; model.title = txtTitle.Text.Trim(); model.is_lock = Utils.StrToInt(rblIsLock.SelectedValue, 0); if (cbIsRed.Checked == true) { model.is_red = 1; } else { model.is_red = 0; } model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99); model.user_name = txtUserName.Text.Trim(); model.user_tel = txtUserTel.Text.Trim(); model.email = txtEmail.Text.Trim(); model.site_url = txtSiteUrl.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.is_image = 1; if (string.IsNullOrEmpty(model.img_url)) { model.is_image = 0; } if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改友情链接:" + model.title); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = true; BLL.link bll = new BLL.link(); Model.link model = bll.GetModel(_id); model.title = txtTitle.Text.Trim(); model.is_lock = int.Parse(rblIsLock.SelectedValue); model.is_red = int.Parse(rblIsRed.SelectedValue); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.user_name = txtUserName.Text.Trim(); model.user_tel = txtUserTel.Text.Trim(); model.email = txtEmail.Text.Trim(); model.site_url = txtSiteUrl.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.is_image = 1; if (string.IsNullOrEmpty(model.img_url)) { model.is_image = 0; } if (!bll.Update(model)) { result = false; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.link bll = new BLL.link(); Model.link model = bll.GetModel(_id); model.site_path = ddlSitePath.SelectedValue; model.title = txtTitle.Text.Trim(); model.is_lock = Utils.StrToInt(rblIsLock.SelectedValue, 0); if (cbIsRed.Checked == true) { model.is_red = 1; } else { model.is_red = 0; } model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99); model.user_name = txtUserName.Text.Trim(); model.user_tel = txtUserTel.Text.Trim(); model.email = txtEmail.Text.Trim(); model.site_url = txtSiteUrl.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.is_image = 1; if (string.IsNullOrEmpty(model.img_url)) { model.is_image = 0; } if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改友情链接:" + model.title); //记录日志 result = true; } return result; }