/// <summary> /// 행추가 버튼 클릭 이벤트 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnRowAdd_First_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { try { var newItem = new CustMgnt { CST_CD = string.Empty , CST_NM = string.Empty , ADDR = string.Empty , ZIP_CD = string.Empty , TEL_NO = string.Empty , CRT_SPR_CD = string.Empty , USE_YN = "Y" , IsNew = true , IsSelected = true , IsSaved = false }; this.CustMgntList.Add(newItem); this.gridMaster.Focus(); this.gridMaster.CurrentColumn = this.gridMaster.Columns.First(); this.gridMaster.View.FocusedRowHandle = this.CustMgntList.Count - 1; this.CustMgntList[this.CustMgntList.Count - 1].BackgroundBrush = new SolidColorBrush(Colors.White); this.CustMgntList[this.CustMgntList.Count - 1].BaseBackgroundBrush = new SolidColorBrush(Colors.White); } catch (Exception err) { this.BaseClass.Error(err); } }
private static void View_ShowingEditor(object sender, ShowingEditorEventArgs e) { try { if (g_IsAuthAllYN == false) { e.Cancel = true; return; } TableView tv = sender as TableView; CustMgnt dataMember = tv.Grid.CurrentItem as CustMgnt; if (dataMember == null) { return; } if (dataMember.CRT_SPR_CD.ToString().Equals("WMS")) { //CRT_SPR_CD 코드가 WMS인 경우 모든 컬럼 수정 불가 switch (e.Column.FieldName) { case "CST_CD": case "CST_NM": case "ADDR": case "ZIP_CD": case "TEL_NO": case "CRT_SPR_CD": case "USE_YN": if (dataMember.IsNew == false) { e.Cancel = true; } break; default: break; } } else { //CRT_SPR_CD 코드가 WCS인 경우 switch (e.Column.FieldName) { // 컬럼이 행추가 상태 (신규 Row 추가)가 아닌 경우 // 센터코드는 수정이 되지 않도록 처리한다. case "CST_CD": if (dataMember.IsNew == false) { e.Cancel = true; } break; default: break; } } } catch { throw; } }
/// <summary> /// 데이터 저장 /// </summary> /// <param name="_da">DataAccess 객체</param> /// <param name="_item">저장 대상 아이템 (Row 데이터)</param> /// <returns></returns> private async Task <bool> SaveSP_SAVE(BaseDataAccess _da, CustMgnt _item, bool UPD) { bool isRtnValue = true; #region 라메터 변수 선언 및 값 할당 DataTable dtRtnValue = null; string strProcedureName = String.Empty; if (UPD == true) { strProcedureName = "PK_C1011.SP_CST_UPD"; } else if (UPD == false) { strProcedureName = "PK_C1011.SP_CST_INS"; } Dictionary <string, object> dicInputParam = new Dictionary <string, object>(); string[] arrOutputParam = { "O_RTN_RSLT" }; var strCstCD = _item.CST_CD; var strCstNM = _item.CST_NM; var strAddr = _item.ADDR; var strZipCD = _item.ZIP_CD; var strTelNO = _item.TEL_NO; var strUseYN = _item.Checked == true ? "Y" : "N"; var strUserID = this.BaseClass.UserID; #endregion #region Input 파라메터 dicInputParam.Add("P_CST_CD", strCstCD); dicInputParam.Add("P_CST_NM", strCstNM); dicInputParam.Add("P_ADDR", strAddr); dicInputParam.Add("P_ZIP_CD", strZipCD); dicInputParam.Add("P_TEL_NO", strTelNO); dicInputParam.Add("P_USE_YN", strUseYN); dicInputParam.Add("P_USER_ID", strUserID); #endregion await System.Threading.Tasks.Task.Run(() => { dtRtnValue = _da.GetSpDataTable(strProcedureName, dicInputParam, arrOutputParam); }).ConfigureAwait(true); if (dtRtnValue != null) { if (dtRtnValue.Rows.Count > 0) { if (dtRtnValue.Rows[0]["CODE"].ToString().Equals("0") == false) { this.BaseClass.MsgError(dtRtnValue.Rows[0]["MSG"].ToString(), BaseEnumClass.CodeMessage.MESSAGE); isRtnValue = false; } } else { this.BaseClass.MsgError("ERR_SAVE"); isRtnValue = false; } } return(isRtnValue); }