Пример #1
0
        private bool AddFollowUpLog(int customerId)
        {
            bool result = false;

            try
            {
                string email    = TxtBoxEmail.Text.Trim();
                string company  = TxtBoxCompanyName.Text;
                int    number   = Convert.ToInt32(NumUpDownNumber.Value);
                string datetime = DTPDate.Value.ToLocalTime().ToString();
                string state    = ComboBoxState.Text;
                string briefing = TxtBoxBriefing.Text;
                string content  = RichTxtBoxContent.Text;
                string modify   = DateTime.Now.ToLocalTime().ToString();

                result = CFUSystem.AddFollowUpLog(email, company, customerId,
                                                  number, datetime, state,
                                                  briefing, content,
                                                  modify, this.Seller);
                if (result)
                {
                    LoadAllLogs(customerId);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            return(result);
        }
Пример #2
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            try
            {
                FrmLogin frmLogin = new FrmLogin();
                frmLogin.ShowDialog(this);
                if (DialogResult.OK != frmLogin.DialogResult)
                {
                    this.Close();
                    return;
                }
                this.UserName = frmLogin.UserName;

                LblUserName.Text = UserName;

                DataSet dataSet = CFUSystem.QueryCustomerInfoBySellerName(this.UserName);
                DataGridViewCustomerInfo.DataSource = dataSet;
                DataGridViewCustomerInfo.DataMember = "TB_CustomerInfo";
                FormatDataGridView(DataGridViewCustomerInfo);

                //this.SelectedCustomerIds = new List<object>();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #3
0
        private void BtnFinish_Click(object sender, EventArgs e)
        {
            try
            {
                string email         = TxtBoxEmail.Text.Trim();
                string archivingDate = DTPArchiving.Value.ToLocalTime().ToString();
                string sort          = ComboBoxSort.Text;
                string contacts      = TxtBoxContacts.Text;
                string company       = TxtBoxCompanyName.Text;
                string website       = TxtBoxWebsite.Text;
                string country       = TxtBoxCountry.Text;
                string address       = TxtBoxAddress.Text;
                string scope         = TxtBoxBusinessScope.Text;
                string type          = TxtBoxType.Text;
                string demand        = TxtBoxDemand.Text;
                string telephone     = TxtBoxTelephone.Text;
                string fax           = TxtBoxFax.Text;
                string mobile        = TxtBoxMobile.Text;
                string msn           = TxtBoxMSN.Text;
                string skype         = TxtBoxSkype.Text;
                string linkin        = TxtBoxLinkin.Text;
                string whatsapp      = TxtBoxWhatsApp.Text;
                string twiter        = TxtBoxTwiter.Text;
                string facebook      = TxtBoxFacebook.Text;
                string comefrom      = TxtBoxComeFrom.Text;
                string belongsto     = TxtBoxBelongsTo.Text;
                string remarks       = TxtBoxRemarks.Text;
                string datetime      = DateTime.Now.ToLocalTime().ToString();

                if (WorkingState.Add == this.WorkingState)
                {
                    int identity = CFUSystem.AddCustomerReturnIdentity(archivingDate, sort,
                                                                       contacts, email,
                                                                       company, website,
                                                                       country, address,
                                                                       scope, type, demand,
                                                                       telephone, fax, mobile, msn, skype, linkin, whatsapp, twiter, facebook,
                                                                       comefrom, belongsto,
                                                                       remarks, datetime);
                    if (identity > 0)
                    {
                        this.CustomerId = identity;
                        bool result = AddFollowUpLog(identity);
                        if (result)
                        {
                            this.DialogResult = DialogResult.OK;
                            this.Close();
                        }
                    }
                }
                else if (WorkingState.Modify == this.WorkingState)
                {
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #4
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            Cursor.Current           = Cursors.WaitCursor;
            txtBoxErrMessage.Visible = false;

            try
            {
                string userName = txtBoxUserName.Text.Trim();
                if (string.IsNullOrWhiteSpace(userName))
                {
                    txtBoxErrMessage.Visible = true;
                    txtBoxErrMessage.Text    = "用户名不能为空";
                    txtBoxUserName.Focus();
                    Cursor.Current = Cursors.Default;
                    return;
                }

                bool userIsExist = CFUSystem.QueryUserName(userName);
                if (!userIsExist)
                {
                    txtBoxErrMessage.Visible = true;
                    txtBoxErrMessage.Text    = "用户不存在";
                    txtBoxUserName.Focus();
                    Cursor.Current = Cursors.Default;
                    return;
                }

                string password           = txtBoxPassword.Text.Trim();
                bool   isRememberPassword = ckBoxRememberPassword.Checked;

                Console.WriteLine("userName:"******" password:"******" isRememberPassword:"******"loginResult:" + loginResult);

                if (loginResult)
                {
                    if (isRememberPassword)
                    {
                        AppConfigHelper.SetConfigValue(userName, password);
                    }

                    string mac   = SystemInfo.GetMac();
                    string lanIp = SystemInfo.GetLanIp();
                    //string wanIp = SystemInfo.GetWanIp();
                    //string wanIp = "";
                    string datetime    = DateTime.Now.ToLocalTime().ToString();
                    string hostName    = SystemInfo.GetHostName();
                    string sysUserName = SystemInfo.GetUserName();

                    Console.WriteLine("username:"******"mac:" + mac + " LanIp:" + lanIp + " hostName:" + hostName + " datetime:" + datetime);

                    CFUSystem.AddLoginLog(userName, datetime, mac, lanIp, hostName, sysUserName);
                    CFUSystem.ModifyLastLoginLog(userName, datetime, mac, lanIp, hostName, sysUserName);

                    this.UserName     = userName;
                    this.DialogResult = DialogResult.OK;

                    this.Close();
                }
                else
                {
                    txtBoxErrMessage.Visible = true;
                    txtBoxErrMessage.Text    = "密码错误";
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Cursor.Current = Cursors.Default;
        }