/// <summary> /// 資料捨棄 /// </summary> protected bool Drop() { SystemCodeDB myDB = new SystemCodeDB(base.strUserID, base.FormID); try { //取UI欄位值 SystemCodeBufInfo BuffInfo = null; GetModFieldValue(out BuffInfo); //是否在Buffer資料且已經送審中 bool IsExistBuffer = myDB.chkSystemCode(BuffInfo, SystemCodeDB.TableType.Buffer, "INCHECKER"); if (IsExistBuffer) { base.DoAlertinAjax(this, "SAVE", "該筆資料已經送審,不可捨棄!"); return(false); } else { myDB.DelSysteCodeBuff(BuffInfo); base.DoAlertinAjax(this, "SAVE", "捨棄完成!"); return(true); } } catch (Exception ex) { base.DoAlertinAjax(this, "SAVE", "作業發生錯誤,錯誤訊息:" + ex.Message); return(false); } }
public void DataListLoad() { SystemCodeDB myDB = new SystemCodeDB(base.strUserID, base.FormID); string Type = ddlqType.SelectedValue; string Value = txtqValue.Text.Trim(); string Text = txtqText.Text.Trim(); #region 依查詢條件取得總筆數 int TotalCount = 0; DataTable CountDt = myDB.getSystemCode(Type, Value, Text, SystemCodeDB.SelectType.Count, SystemCodeDB.WorkType.Maker); if (CountDt != null && CountDt.Rows.Count > 0) { DataRow CountDr = CountDt.Rows[0]; TotalCount = Convert.ToInt32(CountDr["ROW_COUNT"]); } #endregion ucDataGridView1._TotalCount = TotalCount; ucDataGridView1.ToFirst(); }
protected void BindSystemCodeType(DropDownList ddl) { SystemCodeDB myDB = new SystemCodeDB(base.strUserID, base.FormID); DataTable Dt = myDB.getSystemCode_distinct(); ddlqType.DataSource = Dt; ddlqType.DataValueField = "type"; ddlqType.DataTextField = "type"; ddlqType.DataBind(); ddlqType.Items.Insert(0, new ListItem("請選擇", "")); }
protected void ucDataGridView1_ChangePageClick(int _OffsetCount, int _FetchCount) { string Type = ddlqType.SelectedValue; string Value = txtqValue.Text.Trim(); string Text = txtqText.Text.Trim(); SystemCodeDB myDB = new SystemCodeDB(base.strUserID, base.FormID); DataTable dt = myDB.getSystemCode(Type, Value, Text, SystemCodeDB.SelectType.Query, SystemCodeDB.WorkType.Maker, _OffsetCount, _FetchCount); repDataListBind(dt); }
/// <summary> /// 資料刪除 /// </summary> protected bool Delete() { SystemCodeDB myDB = new SystemCodeDB(base.strUserID, base.FormID); try { //取UI欄位值 SystemCodeBufInfo BuffInfo = null; GetModFieldValue(out BuffInfo); //是否有在正式資料中 bool IsExistOfficial = myDB.chkSystemCode(BuffInfo, SystemCodeDB.TableType.Official); //是否在Buffer資料中 bool IsExistBuffer = myDB.chkSystemCode(BuffInfo, SystemCodeDB.TableType.Buffer); BuffInfo.StepID = "20"; BuffInfo.MODItem = "D"; BuffInfo.Maker = base.strUserID; BuffInfo.Maker_Time = DateTime.Now; //若資料不在正式資料中就不可刪除 if (!IsExistOfficial) { base.DoAlertinAjax(this, "SAVE", "該資料不存在於正式資料中,不可執行申請刪除作業!"); return(false); } //如果存在於Buffer就Update反之則新增 if (IsExistBuffer) { myDB.UpdSystemCodeBuff(BuffInfo); } else { myDB.InsSystemCodeBuff(BuffInfo); } base.DoAlertinAjax(this, "SAVE", "申請刪除完成!"); return(true); } catch (Exception ex) { base.DoAlertinAjax(this, "SAVE", "作業發生錯誤,錯誤訊息:" + ex.Message); return(false); } }
/// <summary> /// 資料更新 /// </summary> protected bool Update(string StepID) { SystemCodeDB myDB = new SystemCodeDB(base.strUserID, base.FormID); try { //取UI欄位值 SystemCodeBufInfo BuffInfo = null; GetModFieldValue(out BuffInfo); //是否有在正式資料中 bool IsExistOfficial = myDB.chkSystemCode(BuffInfo, SystemCodeDB.TableType.Official); //是否在Buffer資料中 bool IsExistBuffer = myDB.chkSystemCode(BuffInfo, SystemCodeDB.TableType.Buffer); BuffInfo.StepID = StepID; BuffInfo.MODItem = IsExistOfficial ? "U" : "I"; BuffInfo.Maker = base.strUserID; BuffInfo.Maker_Time = DateTime.Now; //如果存在於Buffer就Update反之則新增 if (IsExistBuffer) { myDB.UpdSystemCodeBuff(BuffInfo); } else { myDB.InsSystemCodeBuff(BuffInfo); } if (StepID == "5") { base.DoAlertinAjax(this, "SAVE", "暫存完成!"); } else { base.DoAlertinAjax(this, "SAVE", "送審完成!"); } return(true); } catch (Exception ex) { base.DoAlertinAjax(this, "SAVE", "作業發生錯誤,錯誤訊息:" + ex.Message); return(false); } }
//按下編輯按鈕 protected bool View(string Type, string Value) { SystemCodeDB myDB = new SystemCodeDB(base.strUserID, base.FormID); //是否有在正式資料中 bool IsExistOfficial = myDB.chkSystemCode(Type, Value, SystemCodeDB.TableType.Official); //是否在Buffer資料中 bool IsExistBuffer = myDB.chkSystemCode(Type, Value, SystemCodeDB.TableType.Buffer); if (IsExistBuffer || IsExistOfficial) { SystemCodeBufInfo iInfo = new SystemCodeBufInfo(); if (IsExistBuffer) { myDB.LoadSystemCodeBuff(Type, Value, out iInfo); } else if (IsExistOfficial) { SystemCodeInfo myInfo; myDB.LoadSystemCode(Type, Value, out myInfo); iInfo = new SystemCodeBufInfo(myInfo); } FillModFieldValue(iInfo); SetBtnStatus(IsExistBuffer, IsExistOfficial); return(true); } else { base.DoAlertinAjax(this, "SAVE", "該筆資料可能已被刪除,請重新查詢。"); return(false); } }