コード例 #1
0
 public override void Save()
 {
     if (IsEmpty() == false)
     {
         return;
     }
     else
     {
         var db = new SalesDataContext();
         if (categoy.id == 0)
         {
             Action = "Insert";
             db.product_categories.InsertOnSubmit(categoy);
         }
         else
         {
             Action = "Update";
             db.product_categories.Attach(categoy);
         }
         SetData();
         db.SubmitChanges();
         Txt_Name.Text = string.Empty;
         Txt_Name.Focus();
         base.Save();
     }
 }
コード例 #2
0
 public Form1()
 {
     InitializeComponent();
     Txt_Name.Clear();
     Txt_Psw.Clear();
     //skinEngine1.SkinFile = System.Environment.CurrentDirectory + "\\Skins\\MidsummerColor1.ssk";  //皮肤文件以 .ssk结尾
 }
コード例 #3
0
 private void Btn_New_Click(object sender, EventArgs e)
 {
     _User.Nick         = Txt_Nick.Text.ToString();
     _User.Password     = "******";
     _User.Name         = Txt_Name.Text.ToString();
     _User.Surname      = Txt_Surname.Text.ToString();
     _User._userType.Id = Convert.ToInt32(((DataRowView)cbprofile.SelectedItem)["Id"]);
     if (Txt_Nick.Text.Trim() != "")
     {
         Error.Clear();
         if (Txt_Name.Text.Trim() != "")
         {
             Error.Clear();
             if (Txt_Surname.Text.Trim() != "")
             {
                 Error.Clear();
                 var uschk = _User.CheckUser(Txt_Nick.Text);
                 if (uschk == true)
                 {
                     Error.SetError(Txt_Nick, "El nombre de usuario " + _User.Nick + " ya existe en el sistema.\nPor favor ingrese otro para continuar.");
                     Txt_Nick.Clear();
                 }
                 else
                 {
                     _User.NewUser(_User);
                     MessageBox.Show("El usuario fue creado correctamente", "Registro de usuario", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     Txt_Surname.Clear();
                     Txt_Name.Clear();
                     Txt_Pass.Clear();
                     Txt_RPass.Clear();
                     Txt_Pass.Clear();
                     Txt_RPass.Clear();
                     Txt_Nick.Clear();
                     Txt_Nick.Clear();
                     L.Action     = "El usuario " + Users.CacheUser.Nick + " registró un nuevo usuario: " + _User.Nick;
                     L.ActionDate = DateTime.Now;
                     L._users.Id  = Users.CacheUser.Id;
                     L.WriteLog(L);
                 }
             }//Apellido
             else
             {
                 Error.SetError(Txt_Surname, "Debe ingresar el apellido");
             }
         }//Name
         else
         {
             Error.SetError(Txt_Name, "Debe ingresar el nombre");
         }
     }//Nick
     else
     {
         Error.SetError(Txt_Nick, "Debe ingresar el nick del usuario");
     }
 }//BTN
コード例 #4
0
 public bool FormIsComplete()
 {
     if (!Txt_ID.Equals("") && !Txt_Name.Equals(""))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #5
0
        public void AddDetailsToBookProduct(String sName, String sMobileNumber, String sPincode, String sLocality, String sAddress, String sCity, String sLandmark, String sAlternativePhNum, String sCardNum, String sCVV)
        {
            Console.WriteLine("Enter the address");
            Btn_ChangeAddress.Click();
            Btn_EditAddress.Click();

            Txt_Name.SendKeys(Keys.Control + "a");
            Txt_Name.SendKeys(sName);

            Txt_MobileMumber.SendKeys(Keys.Control + "a");
            Txt_MobileMumber.SendKeys(sMobileNumber);

            Txt_Pincode.SendKeys(Keys.Control + "a");
            Txt_Pincode.SendKeys(sPincode);

            Txt_Locality.SendKeys(Keys.Control + "a");
            Txt_Locality.SendKeys(sLocality);

            Txt_Address.SendKeys(Keys.Control + "a");
            Txt_Address.SendKeys(sAddress);

            Txt_City.SendKeys(Keys.Control + "a");
            Txt_City.SendKeys(sCity);

            Txt_Lankmark.SendKeys(Keys.Control + "a");
            Txt_Lankmark.SendKeys(sLandmark);

            Txt_AlternativePhNum.SendKeys(Keys.Control + "a");
            Txt_AlternativePhNum.SendKeys(sAlternativePhNum);

            Btn_SaveAndDeliver.Click();

            Console.WriteLine("Address added successfully");
            //Thread.Sleep(5000);
            //Btn_Continue.Click();

            //Thread.Sleep(5000);
            //Btn_Credit_DebitCard.Click();

            //Thread.Sleep(5000);
            //Txt_CardNum.SendKeys(Keys.Control + "a");
            //Txt_CardNum.SendKeys(sCardNum);

            //Thread.Sleep(5000);
            //Txt_CVV.SendKeys(Keys.Control + "a");
            //Txt_CVV.SendKeys(sCVV);

            Console.WriteLine("Details added to book the required product succesfully");

            Lnk_Flipkart_Mainpage.Click();
        }
コード例 #6
0
        public string Name()
        {
            string Nombre;

            if (!Txt_Name.Equals(""))
            {
                Nombre = Txt_Name.Text.ToString();
            }
            else
            {
                MessageBox.Show(@"Error al ingresar el campo: Nombre.");
                Nombre = "ERROR";
            }
            return(Nombre);
        }
コード例 #7
0
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_login_Click(object sender, EventArgs e)
        {
            string Name = Txt_Name.Text.Trim();
            string Psw  = Txt_Psw.Text.Trim();

            if (string.IsNullOrEmpty(Name))
            {
                MsgBoxHelper.MsgErrorShow("账号为空");
                Txt_Name.Focus();
                return;
            }
            if (string.IsNullOrEmpty(Psw))
            {
                MsgBoxHelper.MsgErrorShow("密码为空");
                Txt_Psw.Focus();
                return;
            }
            string enPSW = MD5Encrypt.Encrypt(Psw);

            try
            {
                LoginBLL login = new LoginBLL();
                List <View_StndentRole> StuList = login.Login(Name, enPSW);
                if (StuList == null || StuList.Count == 0)
                {
                    MsgBoxHelper.MsgErrorShow("账号或密码错误");
                    return;
                }
                else
                {
                    MainIndex index = new MainIndex();
                    index.Tag = new LoginModel()
                    {
                        StuList    = StuList,
                        LoginForm1 = this
                    };
                    index.Show();
                    this.Hide();
                }
            }
            catch (Exception exception)
            {
                MsgBoxHelper.MsgErrorShow("登录出现错误");
            }
        }
コード例 #8
0
        void ReleaseDesignerOutlets()
        {
            if (Label_count != null)
            {
                Label_count.Dispose();
                Label_count = null;
            }

            if (Txt_Name != null)
            {
                Txt_Name.Dispose();
                Txt_Name = null;
            }

            if (Txt_param != null)
            {
                Txt_param.Dispose();
                Txt_param = null;
            }
        }