Ejemplo n.º 1
0
 void CreateSaleOrder()
 {
     dgvData.EndEdit();
     try
     {
         if (dgvData.Rows.Where(x => x.Cells["S"].Value.ToBool()).Count() > 0)
         {
             List <int> idList = new List <int>();
             var        a      = new List <int>();
             foreach (var ix in dgvData.Rows)
             {
                 if (dbClss.TBo(ix.Cells["S"].Value))
                 {
                     a.Add(dbClss.TInt(ix.Cells["id"].Value));
                     break;
                 }
             }
             var so = new SaleOrder(a);
             so.ShowDialog();
         }
         else
         {
             baseClass.Warning("Please select data.");
             return;
         }
     }
     catch (Exception ex)
     {
         baseClass.Warning(ex.Message);
     }
 }
Ejemplo n.º 2
0
 private void radButtonElement1_Click(object sender, EventArgs e)
 {
     //select Item
     if (sType == 1)
     {
         var t = new SaleOrder();
         t.ShowDialog();
     }
     else
     {
         selRow();
     }
 }
Ejemplo n.º 3
0
 void selRow()
 {
     if (dgvData.CurrentCell != null && dgvData.CurrentCell.RowIndex >= 0)
     {
         var row = dgvData.CurrentCell.RowInfo;
         if (dgvData.CurrentCell.ColumnInfo.Name == "RefNo") //JobNo
         {
             var j = new ProductionOrder(row.Cells["RefNo"].Value.ToSt());
             j.ShowDialog();
         }
         else if (dgvData.CurrentCell.ColumnInfo.Name == "CustomerPONo_TEMP")
         {
             int idDt = row.Cells["idCstmPODt"].Value.ToInt();
             using (var db = new DataClasses1DataContext())
             {
                 //var hd = db.mh_CustomerPODTs.Where(x => x.id == idDt && !x.forSafetyStock).FirstOrDefault();
                 var hd = db.mh_SaleOrderDTs.Where(x => x.id == idDt && !x.forSafetyStock).FirstOrDefault();
                 if (hd != null)
                 {
                     //var c = new CustomerPO(hd.idCustomerPO);
                     var c = new SaleOrder(hd.SONo);
                     c.ShowDialog();
                 }
             }
         }
         else
         {
             t_PackingNo = row.Cells["PackingNo"].Value.ToSt();
             if (sType == 1)
             {
                 string status = row.Cells["Status"].Value.ToSt();
                 if (status == "Active")
                 {
                     var pk = new Packing(t_PackingNo);
                     pk.ShowDialog();
                 }
                 else
                 {
                     //packing cancel
                 }
                 DataLoad();
             }
             else
             {
                 this.Close();
             }
         }
     }
 }
Ejemplo n.º 4
0
        private void radButtonElement1_Click(object sender, EventArgs e)
        {
            if (dgvData.Rows.Count <= 0)
            {
                return;
            }

            try
            {
                if (sType == 2)
                {
                    dgvData.EndEdit();


                    if (dgvData.CurrentCell == null)
                    {
                        return;
                    }
                    //foreach (GridViewRowInfo rowinfo in dgvData.Rows.Where(o => Convert.ToBoolean(o.Cells["S"].Value)))
                    //{
                    //    RetDT.Add(rowinfo);
                    //}

                    PONo = dgvData.CurrentCell.RowInfo.Cells["SONo"].Value.ToSt();

                    this.Close();
                }
                else
                {
                    dgvData.EndEdit();
                    string temp = "";
                    foreach (var ix in dgvData.Rows)
                    {
                        if (dbClss.TBo(ix.Cells["S"].Value))
                        {
                            temp = dbClss.TSt(ix.Cells["SONo"].Value);
                            break;
                        }
                    }
                    if (temp != "")
                    {
                        SaleOrder a = new SaleOrder(temp);
                        a.ShowDialog();
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Ejemplo n.º 5
0
        void selRow()
        {
            if (dgvData.CurrentCell != null && dgvData.CurrentCell.RowIndex >= 0)
            {
                var rowe = dgvData.CurrentCell.RowInfo;
                PONo   = rowe.Cells["SONo"].Value.ToSt();
                CstmNo = rowe.Cells["CustomerNo"].Value.ToSt();

                if (sType == 1)
                {
                    var p = new SaleOrder(PONo, CstmNo);
                    p.ShowDialog();
                    DataLoad();
                    PONo   = "";
                    CstmNo = "";
                }
                else
                {
                    this.Close();
                }
            }
        }
Ejemplo n.º 6
0
        private void radGridView1_CellDoubleClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
        {
            ////select Item from Double click
            //selRow();
            //demo();

            try
            {
                if (e.RowIndex >= 0)
                {
                    if (dgvData.Rows.Count <= 0)
                    {
                        return;
                    }


                    dgvData.EndEdit();
                    string temp = "";
                    temp = dbClss.TSt(e.Row.Cells["SONo"].Value);
                    if (temp != "")
                    {
                        if (sType == 2)
                        {
                            PONo = temp;
                            this.Close();
                        }
                        else
                        {
                            SaleOrder a = new SaleOrder(temp);
                            a.ShowDialog();
                            DataLoad();
                        }
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }