Пример #1
0
 public uc_StallDetail(uc_Stall parent, PRO_tblStallDTO item)
 {
     InitializeComponent();
     parentForm = parent;
     Initialize();
     LoadDataToEdit(item);
     SetPermission();
 }
Пример #2
0
        public string InsertStall(PRO_tblStallDTO item)
        {
            string strError = "";
            strError = db.sExecuteSQL("PRO_spfrmStall", new string[] { "Activity", "Username", "LanguageID", "StallID", "StallCode", "VNName", "ENName", "WarehouseID", "Rank", "Used", "Note" }, new object[] { item.Activity, item.Username, item.LanguageID, item.StallID, item.StallCode, item.VNName, item.ENName, item.WarehouseID, item.Rank, item.Used, item.Note });

            if (strError.Equals(""))
            {
                strError = this.InsertActionLog(new DTO.System.SYS_tblActionLogDTO
                {
                    Activity = item.Activity,
                    Username = item.Username,
                    LanguageID = item.LanguageID,
                    ActionVN = "Thêm Mới",
                    ActionEN = "Insert",
                    FunctionID = "19",
                    DescriptionVN = string.Format("Tài khoản '{0}' vừa thêm mới thành công quầy bán có mã '{1}'.", item.Username, item.StallCode),
                    DescriptionEN = string.Format("Account '{0}' has inserted new stall successfully with stall code is '{1}'.", item.Username, item.StallCode)
                });
            }

            return strError;
        }
Пример #3
0
 public string UpdateStall(PRO_tblStallDTO item)
 {
     return daoStall.UpdateStall(item);
 }
Пример #4
0
 public string InsertStall(PRO_tblStallDTO item)
 {
     return daoStall.InsertStall(item);
 }
Пример #5
0
        private bool SaveStall(bool isEdit)
        {
            string strError = "";
            try
            {
                PRO_tblStallDTO item = new PRO_tblStallDTO
                {
                    Activity = (isEdit) ? "Update" : "Insert",
                    Username = User.UserInfo.Username,
                    LanguageID = User.UserInfo.LanguageID,
                    StallID = txtStallID.Text,
                    StallCode = txtStallCode.Text,
                    VNName = txtVNName.Text,
                    ENName = txtENName.Text,
                    WarehouseID = gluWarehouse.EditValue + "",
                    Rank = speRank.EditValue,
                    Used = chkUsed.Checked,
                    Note = mmoNote.Text
                };
                strError = (isEdit) ? busStall.UpdateStall(item) : busStall.InsertStall(item);
                if (strError != "")
                {
                    Commons.ShowMessage(strError, 0);
                    txtStallCode.Focus();
                    return false;
                }
                else parentForm.LoadAllData();
            }
            catch (Exception ex)
            {
                Commons.ShowExceptionMessage(ex);
                return false;
            }

            return true;
        }
Пример #6
0
 private void LoadDataToEdit(PRO_tblStallDTO item)
 {
     txtStallID.EditValue = item == null ? null : item.StallID;
     txtStallCode.EditValue = item == null ? null : item.StallCode;
     txtVNName.EditValue = item == null ? null : item.VNName;
     txtENName.EditValue = item == null ? null : item.ENName;
     gluWarehouse.EditValue = item == null ? null : item.WarehouseID;
     speRank.EditValue = item == null ? null : item.Rank;
     chkUsed.Checked = item == null ? true : item.Used;
     mmoNote.EditValue = item == null ? null : item.Note;
     if (item == null)
     {
         depError.ClearErrors();
         this.ParentForm.Text = (User.UserInfo.LanguageID.Equals("VN")) ? "Thêm Mới Quầy Bán" : "Insert New Stall";
     }
     txtStallCode.Focus();
 }