Beispiel #1
0
        private void t_btn_Close_Copy_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                CreateDatabase("server=.\\SQLEXPRESS; uid=sa; pwd=sa123456", "ProjectTracking");

                ExecuteSqlFile("server=.\\SQLEXPRESS; uid=sa; pwd=sa123456", @"C:\Users\40326\Documents\Visual Studio 2017\XProject001\ProjectTracking.git\XProject001\XProjectWPF\DataBase\数据库脚本.sql");

                XMessageBox.Enter("创建成功!", this);
            }
            catch (Exception ex)
            {
                XMessageBox.Exception(ex);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 保存按钮事件
 /// </summary>
 /// <param name="sender">事件对象</param>
 /// <param name="e">事件参数</param>
 private void t_tsb_Save_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         bool isSuccess = SaveMethod();
         if (isSuccess)
         {
             XMessageBox.Enter("保存成功", this);
             m_IsModify = false;
         }
     }
     catch (Exception ex)
     {
         XMessageBox.Exception(ex);
     }
 }
Beispiel #3
0
        /// <summary>
        /// 生成项目单
        /// </summary>
        /// <param name="sender">事件对象</param>
        /// <param name="e">事件参数</param>
        private void t_tsb_CreateProject_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (m_IsModify || t_txt_QuotationNo.Text == "新单")
                {
                    XMessageBox.Enter("当前单据尚未保存,请保存后再操作!", this);
                    return;
                }
                m_IsModify      = false;
                this.Visibility = Visibility.Hidden;

                PT_B_Project myModel = new PT_B_Project();
                myModel.Project_Id         = Guid.NewGuid().ToString("N");
                myModel.Quotation_No       = PTBQuotation.Quotation_No;
                myModel.Quotation_Date     = PTBQuotation.Quotation_Date;
                myModel.Follow_Man         = PTBQuotation.Follow_Man;
                myModel.Product_Model      = PTBQuotation.Product_Model;
                myModel.Project_Name       = PTBQuotation.Project_Name;
                myModel.Price              = PTBQuotation.Price;
                myModel.Is_Tax             = PTBQuotation.Is_Tax;
                myModel.Project_Type       = PTBQuotation.Quotation_Type;
                myModel.Cycle_Time         = PTBQuotation.Cycle_Time;
                myModel.Company_Name       = PTBQuotation.Company_Name;
                myModel.Company_Address    = PTBQuotation.Company_Address;
                myModel.Contact_Man        = PTBQuotation.Contact_Man;
                myModel.Tel                = PTBQuotation.Tel;
                myModel.Email              = PTBQuotation.Email;
                myModel.Fax                = PTBQuotation.Fax;
                myModel.Remark             = PTBQuotation.Remark;
                myModel.Oper_Time          = DateTime.Now;
                myModel.Account_Receivable = PTBQuotation.Price;
                myModel.Profits            = PTBQuotation.Price;
                FrmProject myForm = new FrmProject();
                myForm.PTBProject = myModel;
                myForm.ShowDialog();

                this.Close();
            }
            catch (Exception ex)
            {
                XMessageBox.Exception(ex);
            }
        }