예제 #1
0
        private bool SetApprove()
        {
            bool ret = true;
            ArrayList arrLOID = new ArrayList();
            for (int i = 0; i < grvProductStockInShop.Rows.Count; i++)
            {
                arrLOID.Add(grvProductStockInShop.Rows[i].Cells["SILOID"].Value.ToString());
            }


            ProductStockInShopFlow csFlow = new ProductStockInShopFlow();
            if (txtSiiStatus.Text.Trim () != "")
                ret = csFlow.UpdateStockInData(Appz.CurrentUserData.UserID, arrLOID);
            else
                ret = csFlow.UpdateStockInApproveData(Appz.CurrentUserData.UserID, arrLOID);

            if (ret == false)
                Appz.OpenWarningDialog(csFlow.ErrorMessage);
            return ret;
        }
예제 #2
0
        private void btnApprove_Click(object sender, EventArgs e)
        {
            bool ret = true;

            for (int i = 0; i < grvPDSearchInShop.Rows.Count  ; i++)
            {

                DataGridViewTextBoxCell SISTATUS = (DataGridViewTextBoxCell)grvPDSearchInShop.Rows[i].Cells["SISTATUS"];
                if (SISTATUS.Value.ToString() == "AP")
                {
                    Appz.OpenWarningDialog("ÃÒ¡ÒùÕé¶Ù¡Â×¹ÂѹáÅéÇ");
                    return;
                }                
            }
            if (Appz.OpenQuestionDialog("µéͧ¡ÒÃÂ×¹ÂѹÃѺà¢éÒ¤ÅѧËÃ×ÍäÁè?") == DialogResult.OK)
            {
                ArrayList arrLOID = new ArrayList();
                for (int i = 0; i < grvPDSearchInShop.Rows.Count; i++)
                {
                    DataGridViewCheckBoxCell maCell = (DataGridViewCheckBoxCell)this.grvPDSearchInShop.Rows[i].Cells["CHKAPPROVE"];

                    if (maCell.FormattedValue.Equals(true))
                    {
                        arrLOID.Add(grvPDSearchInShop.Rows[i].Cells["LOID"].Value.ToString());                            
                    }
                }
                ProductStockInShopFlow csFlow = new ProductStockInShopFlow();
                ret = csFlow.UpdateStockInData(Appz.CurrentUserData.UserID, arrLOID);

                if (ret == true)
                    Appz.OpenInformationDialog("ºÑ¹·Ö¡ÃÒ¡ÒÃàÃÕºÃéÍÂ");
                else
                    Appz.OpenWarningDialog(csFlow.ErrorMessage);
                LoadData();
            }
        }