示例#1
0
 private void SetUpsimpleButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (BargainYEScheckEdit.Checked == true)
         {
             bargain = 1;
         }
         if (BargainNONEcheckEdit.Checked == true)
         {
             bargain = 0;
         }
         if (InsuranceNOcheckEdit.Checked == true)
         {
             insurance = 0;
         }
         if (InsuranceYEScheckEdit.Checked == true)
         {
             insurance = 1;
         }
         if (ContractMoneycheckEdit.Checked == true)
         {
             contractmoney = 1;
         }
         else
         {
             contractmoney = 0;
         }
         if (ContractCostcheckEdit.Checked == true)
         {
             contractcost = 1;
         }
         else
         {
             contractcost = 0;
         }
         string content = $"'{DatedateEdit.DateTime.ToString("yyyy/MM/dd HH:mm:ss")}', '{ProjectNOtextEdit.Text}', '{OwnerNametextEdit.Text}', '{OwnerAddresstextEdit.Text}', '{OwnerNOtextEdit.Text}', " +
                          $"'{WorkStartdateEdit.DateTime.ToString("yyyy/MM/dd HH:mm:ss")}', '{WorkEnddateEdit.DateTime.ToString("yyyy/MM/dd HH:mm:ss")}', '{ContacttextEdit.Text}', '{ContactPhonetextEdit.Text}', '{ProjectLeadertextEdit.Text}', " +
                          $"'{ProjectWorkLeadertextEdit.Text}', '{BargainPersontextEdit.Text}', {bargain}, '{BargainRensontextEdit.Text}', '{BargaindateEdit.DateTime.ToString("yyyy/MM/dd HH:mm:ss")}', " +
                          $"'{BargainLocaltextEdit.Text}', '{BargainPricecomboBoxEdit.Text}', {Convert.ToInt32(BargainMoneytextEdit.Text)}, '{QuotationCodetextEdit.Text}', {Convert.ToInt32(QuotationPricetextEdit.Text)}, " +
                          $"{insurance}, '{InsuranceStartdateEdit.DateTime.ToString("yyyy/MM/dd HH:mm:ss")}', '{InsuranceEnddateEdit.DateTime.ToString("yyyy/MM/dd HH:mm:ss")}', {Convert.ToInt32(ContractMoneytextEdit.Text)}, {contractmoney}, " +
                          $"'{PlanCosttextEdit.Text}',{contractcost}, '{PlanGoaltextEdit.Text}', '{PONumbertextEdit.Text}'";
         SQLMethod.Insert_dispatchdatatable(content);
         MessageBox.Show("專案建立成功!");
     }
     catch (Exception ex)
     {
         Log.Error(ex, "專案建立失敗!");
         MessageBox.Show("專案建立失敗!");
     }
 }