示例#1
0
        /// <summary>
        /// Function to update multiple unit details to tbl_UnitConversion table
        /// </summary>
        public void UnitConvertionEditTableFill()
        {

            try
            {
                UnitConvertionSP spUnitConvertion = new UnitConvertionSP();
                UnitConvertionInfo infoUnitConversion = new UnitConvertionInfo();

                for (int i = 0; i < dtblFromMulUnitForUpdate.Rows.Count; i++)
                {
                    if (Convert.ToDecimal(dtblFromMulUnitForUpdate.Rows[i]["unitconvertionId"]) != 0)
                    {

                        infoUnitConversion.ConversionRate = Convert.ToDecimal(dtblFromMulUnitForUpdate.Rows[i]["CnvertionRate"]);
                        infoUnitConversion.UnitId = Convert.ToDecimal(dtblFromMulUnitForUpdate.Rows[i]["dgvtxtUnitId"]);

                        infoUnitConversion.Extra1 = dtblFromMulUnitForUpdate.Rows[i]["extra1"].ToString();
                        infoUnitConversion.Extra2 = dtblFromMulUnitForUpdate.Rows[i]["extra2"].ToString();
                        infoUnitConversion.ExtraDate = Convert.ToDateTime(dtblFromMulUnitForUpdate.Rows[i]["extraDate"]);
                        infoUnitConversion.UnitconvertionId = Convert.ToDecimal(dtblFromMulUnitForUpdate.Rows[i]["unitconvertionId"]);
                        infoUnitConversion.ProductId = decProductIdForEdit;
                        spUnitConvertion.UnitConvertionEdit(infoUnitConversion);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PC:28" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }