Exemplo n.º 1
0
 private void setStatusRequisition(string active,string status)
 {
     bool rt = true;
     ArrayList arr = new ArrayList();
     ReturnSearchFlow csFlow = new ReturnSearchFlow();
     RequisitionData dr = new RequisitionData();
     dr.CODE = txtRqCode.Text.Trim();
     dr.ACTIVE = active.ToString();
     dr.STATUS = status.ToString();
     arr.Add(dr);
     rt = csFlow.UpdateRequisition_Choose(Appz.CurrentUserData.UserID.ToString(), arr);
 }
Exemplo n.º 2
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            int cnt = -1;
            bool ret = true;
            if (Appz.OpenQuestionDialog("µéͧ¡ÒáÅѺ˹éÒ¨ÍËÅÑ¡ãªèËÃ×ÍäÁè?") == DialogResult.OK)
            {
                cnt = ReturnSearchFlow.CheckStockInitemData(_LOID.ToString());

                if (cnt == 0)
                {
                    ReturnSearchFlow RtFlow = new ReturnSearchFlow();
                    
                    ret = RtFlow.DeleteStockInData(_LOID.ToString());
                    if (txtSiiStatus.Text.Trim() != "")
                        setStatusRequisition("0", "VO");
                    else
                        setStatusRequisition("1", "AP");

                }
                this.Close();
            }
        }
Exemplo n.º 3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            bool ret = true;
            bool rt = true;
            if (Appz.OpenQuestionDialog("µéͧ¡ÒÃźÃÒ¡ÒÃãªèËÃ×ÍäÁè?") == DialogResult.OK)
            {
                ArrayList arrLOID = new ArrayList();
                ArrayList arr = new ArrayList();
                ReturnSearchFlow csFlow = new ReturnSearchFlow();
                
                for (int i = 0; i < grvReturnSearch.Rows.Count; i++)
                {
                    DataGridViewCheckBoxCell maCell = (DataGridViewCheckBoxCell)this.grvReturnSearch.Rows[i].Cells["CHKAPPROVE"];

                    if (maCell.FormattedValue.Equals(true))
                    {
                        RequisitionData dr = new RequisitionData();
                        arrLOID.Add(grvReturnSearch.Rows[i].Cells["SILOID"].Value.ToString());
                       // arr.Add(grvReturnSearch.Rows[i].Cells["RQCODE"].Value.ToString()); 
                        dr.CODE = grvReturnSearch.Rows[i].Cells["RQCODE"].Value.ToString();
                        dr.ACTIVE = "1";
                        dr.STATUS = "AP";
                        arr.Add(dr);
                    }
                }
                ret = csFlow.DeleteStockIn_StockInitemData(Appz.CurrentUserData.UserID, arrLOID);
                if (ret == true)
                {
                    rt = csFlow.UpdateRequisition_Choose(Appz.CurrentUserData.UserID.ToString(), arr);
                    Appz.OpenInformationDialog("źÃÒ¡ÒÃàÃÕºÃéÍÂ");
                }
                    
                else
                {
                    Appz.OpenWarningDialog(csFlow.ErrorMessage);
                }
                    
                LoadData();
            }
        }
Exemplo n.º 4
0
        private int InsertStockInItem()
        {
            grvReturn.EndEdit();
            ArrayList arr = new ArrayList();
            ArrayList SiArr = new ArrayList();
            bool ret = true;
            bool rr = true;
            double cnt = 0;
            cnt = grvReturn.Rows.Count;
            StockInData sd = new StockInData();
            sd.GRANDTOT = Convert.ToDouble(txtGrandTot.Text.Trim());
            sd.LOID = Convert.ToDouble(_LOID.ToString());
            sd.REASON = txtReason.Text.Trim();
            sd.REMARK = txtRemark.Text.Trim();
            SiArr.Add(sd);
            if (_FLAG == "ADD")
            {
                for (int i = 0; i < cnt; i++)
                {

                    DataGridViewTextBoxCell QTY = (DataGridViewTextBoxCell)grvReturn.Rows[i].Cells["QTY"];
                    DataGridViewTextBoxCell STOCKIN = (DataGridViewTextBoxCell)grvReturn.Rows[i].Cells["SILOID"];
                    DataGridViewTextBoxCell PRODUCT = (DataGridViewTextBoxCell)grvReturn.Rows[i].Cells["PDLOID"];
                    DataGridViewTextBoxCell REFLOID = (DataGridViewTextBoxCell)grvReturn.Rows[i].Cells["RQILOID"];
                    DataGridViewTextBoxCell PRICE = (DataGridViewTextBoxCell)grvReturn.Rows[i].Cells["PRICE"];
                    DataGridViewTextBoxCell ULOID = (DataGridViewTextBoxCell)grvReturn.Rows[i].Cells["ULOID"];

                    StockInItemData dr = new StockInItemData();
                    dr.QTY = Convert.ToDouble(QTY.Value.ToString());
                    dr.STOCKIN = Convert.ToDouble(STOCKIN.Value.ToString());
                    dr.PRODUCT = Convert.ToDouble(PRODUCT.Value.ToString());
                    dr.REFLOID = Convert.ToDouble(REFLOID.Value.ToString());
                    dr.PRICE = Convert.ToDouble(PRICE.Value.ToString());
                    dr.UNIT = Convert.ToDouble(ULOID.Value.ToString());
                    arr.Add(dr);
                }

                ReturnSearchFlow csFlow = new ReturnSearchFlow();
                ret = csFlow.InsertStockInitem(Appz.CurrentUserData.UserID, arr);
                if (ret == true)
                {
                    rr = csFlow.UpdateStockIn_GrandTot(Appz.CurrentUserData.UserID, SiArr);
                    setStatusRequisition("0", "VO");
                    return 1;
                }
                else
                {
                    Appz.OpenWarningDialog(csFlow.ErrorMessage);
                    return 0;
                }
            }
            else
            {
                if (txtSiiStatus.Text.Trim() == "AP")
                {
                    Appz.OpenWarningDialog("ÃÒ¡ÒùÕé¶Ù¡Â×¹ÂѹáÅéÇ");
                    return 0;
                }
                else
                {
                    //¡Ã³Õ update ¨Ó¹Ç¹ÃѺ¤×¹
                //    for (int i = 0; i < cnt; i++)
                //    {
                //        DataGridViewTextBoxCell SIILOID = (DataGridViewTextBoxCell)grvReturn.Rows[i].Cells["SIILOID"];
                //        DataGridViewTextBoxCell QTY = (DataGridViewTextBoxCell)grvReturn.Rows[i].Cells["QTY"];
                //        StockInItemData dr = new StockInItemData();
                //        dr.LOID = Convert.ToDouble(SIILOID.Value.ToString());
                //        dr.QTY = Convert.ToDouble(QTY.Value.ToString());
                //        arr.Add(dr);
                //    }

                //    ReturnSearchFlow csFlow = new ReturnSearchFlow();


                //    ret = csFlow.UpdateTemptable(Appz.CurrentUserData.UserID, arr);
                //    if (ret == true)
                //    {
                //        rr = csFlow.UpdateStockIn_GrandTot(Appz.CurrentUserData.UserID, SiArr);
                //        return 2;
                //    }
                //    else
                //    {
                //        Appz.OpenWarningDialog(csFlow.ErrorMessage);
                        return 0;
                    }
                }
            }
Exemplo n.º 5
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            ReturnSearchFlow csFlow = new ReturnSearchFlow();
            StockInData csData = new StockInData();
            csData.SENDER = Appz.CurrentUserData.Warehouse;
            csData.RECEIVER = Appz.CurrentUserData.Warehouse;
            double loid;

            //insert STockin
            loid = csFlow.InsertStockIn(Appz.CurrentUserData.UserID.ToString(), csData);
            if (loid == 0)
                MessageBox.Show(csFlow.ErrorMessage);
            else
                Openfrm(loid, "ADD");

            LoadData();

        }