Exemplo n.º 1
0
        public void Process()
        {
            if (!IsProcessing)
            {
                return;
            }
            switch (State)
            {
            case ProcessStateType.Delete:
                if (DeleteMatchStones())
                {
                    State = ProcessStateType.Fall;
                }
                else
                {
                    FinishProcess();
                }
                break;

            case ProcessStateType.Fall:
                State = FillEmpty() ? ProcessStateType.Delete : ProcessStateType.Fall;
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        private void KemaskiniKelulusan(string userId, ProcessStateType pst)
        {
            try
            {
                Data.PermohonanStok ps = new Data.PermohonanStok
                {
                    ProcessIdTemp = txtKelulusanProcessIdTemp.Text,
                    ProcessId = int.Parse(txtKelulusanProcessId.Text),
                    KuantitiDiluluskan = int.Parse(txtKelulusanKuantiti.Text),
                    Status = (int)(pst),
                    TarikhDiluluskan = DateTime.Now,
                    PegawaiKelulusanEmpSysId = int.Parse(txtKelulusanEmpSysId.Text),
                };

                string err = PermohonanStokMethods.SP_UpdatePermohonanStokKelulusan(int.Parse(userId), ps);

                if (err == string.Empty)
                {
                    cbpKelulusan.JSProperties["cpErrMsg"] = string.Empty;
                }
                else
                {
                    string errMsg = ConfigurationManager.AppSettings["ErrorMessageStaringSentenceDBError"].ToString();
                    errMsg = errMsg.Replace("BR", "<br><br>");
                    cbpKelulusan.JSProperties["cpErrMsg"] = errMsg + " " + err;
                }
            }
            catch (Exception err)
            {
                string errMsg = ConfigurationManager.AppSettings["ErrorMessageStaringSentenceCaughtByExceptions"].ToString();
                errMsg = errMsg.Replace("BR", "<br><br>");
                cbpKelulusan.JSProperties["cpErrMsg"] = errMsg + " " + err.Message;
            }
        }
Exemplo n.º 3
0
 private void FinishProcess()
 {
     IsProcessing = false;
     State        = ProcessStateType.None;
 }
Exemplo n.º 4
0
 private void StartProcess()
 {
     IsProcessing = true;
     State        = ProcessStateType.Delete;
 }