Пример #1
0
        static private SqlCommand estContParaValue(SqlCommand cmd, DataGridViewRow dgvr)
        {
            cmd.Parameters["@iCod"].Value = Convert.ToString(dgvr.Cells["ItemCode"].Value);
            cmd.Parameters["@item"].Value = Convert.ToString(dgvr.Cells["Item"].Value);
            cmd.Parameters["@iDtl"].Value = Convert.ToString(dgvr.Cells["ItemDetail"].Value);
            cmd.Parameters["@qty"].Value  = Convert.ToDecimal(dgvr.Cells["Quantity"].Value);
            cmd.Parameters["@unit"].Value = Convert.ToString(dgvr.Cells["Unit"].Value);
            // Wakamatsu 20170324
            //cmd.Parameters["@cost"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells["Cost"].Value));

            Calculation calc = new Calculation();

            if (calc.ExtractCalcWord(Convert.ToString(dgvr.Cells["Item"].Value)) == Sign.Discount)
            {
                // Wakamatsu 20170327
                //cmd.Parameters["@cost"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells["Amount"].Value));
                cmd.Parameters["@cost"].Value = SignConvert(Convert.ToString(dgvr.Cells["Amount"].Value));
            }
            // Wakamatsu 20170327
            else
            {
                cmd.Parameters["@cost"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells["Cost"].Value));
            }
            // Wakamatsu 20170324
            cmd.Parameters["@note"].Value = Convert.ToString(dgvr.Cells["Note"].Value);
            return(cmd);
        }
Пример #2
0
        static private SqlCommand planningContParaValue(SqlCommand cmd, DataGridViewRow dgvr)
        {
            cmd.Parameters["@iCod"].Value = Convert.ToString(dgvr.Cells[1].Value);
            cmd.Parameters["@item"].Value = Convert.ToString(dgvr.Cells[2].Value);
            cmd.Parameters["@iDtl"].Value = Convert.ToString(dgvr.Cells[3].Value);
            cmd.Parameters["@qty"].Value  = Convert.ToDecimal(dgvr.Cells[4].Value);
            cmd.Parameters["@unit"].Value = Convert.ToString(dgvr.Cells[5].Value);
            // Wakamatsu 20170329
            //cmd.Parameters["@cost0"].Value = DHandling.ToRegDecimal( Convert.ToString( dgvr.Cells[6].Value ) );
            //cmd.Parameters["@cost1"].Value = DHandling.ToRegDecimal( Convert.ToString( dgvr.Cells[8].Value ) );
            //cmd.Parameters["@cost2"].Value = DHandling.ToRegDecimal( Convert.ToString( dgvr.Cells[10].Value ) );

            Calculation calc = new Calculation();

            if (calc.ExtractCalcWord(Convert.ToString(dgvr.Cells["Item"].Value)) == Sign.Discount)
            {
                cmd.Parameters["@cost0"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells[7].Value));
                cmd.Parameters["@cost1"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells[9].Value));
                cmd.Parameters["@cost2"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells[11].Value));
            }
            else
            {
                cmd.Parameters["@cost0"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells[6].Value));
                cmd.Parameters["@cost1"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells[8].Value));
                cmd.Parameters["@cost2"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells[10].Value));
            }
            // Wakamatsu 20170329
            return(cmd);
        }
Пример #3
0
 static private SqlCommand outsourceContParaValue(SqlCommand cmd, DataGridViewRow dgvr)
 {
     cmd.Parameters["@iCod"].Value = Convert.ToString(dgvr.Cells["ItemCode"].Value);
     cmd.Parameters["@item"].Value = Convert.ToString(dgvr.Cells["Item"].Value);
     cmd.Parameters["@iDtl"].Value = Convert.ToString(dgvr.Cells["ItemDetail"].Value);
     cmd.Parameters["@qty"].Value  = Convert.ToDecimal(dgvr.Cells["Quantity"].Value);
     cmd.Parameters["@unit"].Value = Convert.ToString(dgvr.Cells["Unit"].Value);
     cmd.Parameters["@cost"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells["Cost"].Value));
     cmd.Parameters["@note"].Value = DHandling.ToRegDecimal(Convert.ToString(dgvr.Cells["Note"].Value));
     return(cmd);
 }