public BarcodeAdditionForm(BarcodeDetailsForm bf)
        {
            InitializeComponent();
            ConnectionString = ConfigurationManager.ConnectionStrings["DBServerConnectionString"].ToString();
            brdao            = new BarcodeReaderDAO(ConnectionString);
            ldao             = new LaminatorDAO(ConnectionString);
            btdao            = new BarcodeTransactionDAO(ConnectionString);
            bcdf             = bf;
            udao             = new UserDAO(ConnectionString);
            DeviceIP         = Dns.GetHostEntry(Dns.GetHostName()).AddressList.AsEnumerable().Where(s => s.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).Select(s => s).First().ToString();
            PopulateBarcodeReaderDD();

            if (ChannelServices.RegisteredChannels.Count <IChannel>() <= 0)
            {
                ChannelServices.RegisterChannel(new ChannelSrvc(new HttpChannel(), true), true);
            }

            IEnumerable a = RemotingConfiguration.GetRegisteredWellKnownClientTypes().AsEnumerable();

            if (!RemotingConfiguration.GetRegisteredWellKnownClientTypes().AsEnumerable().Where(s => s.ObjectUrl == "http://" + ConfigurationManager.AppSettings["RemoteServerIP"].ToString() + ":" + ConfigurationManager.AppSettings["RemoteServerPort"] + "/ExcelReportUpdateUtility").Select(s => s).Any())
            {
                RemotingConfiguration.RegisterWellKnownClientType(new WellKnownClientTypeEntry(typeof(ExcelReportUpdateUtility), "http://" + ConfigurationManager.AppSettings["RemoteServerIP"].ToString() + ":" + ConfigurationManager.AppSettings["RemoteServerPort"] + "/ExcelReportUpdateUtility"));
            }

            eru = new ExcelReportUpdateUtility();
            eru.SetClientSystemIP(DeviceIP);
        }
Beispiel #2
0
        public BarcodeSearchForm(User user, BarcodeDetailsForm bdf)
            : this()
        {
            BCDetForm          = bdf;
            DBConnectionString = ConfigurationManager.ConnectionStrings["DBServerConnectionString"].ToString();
            UserControl1 uc1 = new UserControl1(DBConnectionString, BCDetForm);

            this.SearchPanel.Controls.Add(uc1);
            udao = new UserDAO(DBConnectionString);
            this.LoggedInUser = user;
        }
        public BarcodeAdditionForm(BarcodeDetailsForm bdf, User user, BarcodeTransaction bt)
            : this(bdf, user)
        {
            this.lbl_addbcdetails.Text     = "Update Barcode Details";
            this.txt_bcserial.Text         = bt.ModuleSerialNumber.ToString();
            this.dd_bcrserial.SelectedText = bt.BarcodeReaderSerialNumber.ToString();
            BarcodeTransactionID           = bt.ID;
            BarcodeTransErrorID            = bt.ErrorID;
            BarcodeReaderSerialNumber      = bt.BarcodeReaderSerialNumber;

            if (!string.IsNullOrEmpty(BarcodeReaderSerialNumber))
            {
                this.dd_bcrserial.SelectedIndex = dd_bcrserial.FindStringExact(BarcodeReaderSerialNumber);
            }
        }
Beispiel #4
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            try
            {
                if (txt_UserName.Text.Length > 0 && txt_Password.Text.Length > 0)
                {
                    user = udao.GetUserDetails(txt_UserName.Text, txt_Password.Text);

                    if (user.ID > 0)
                    {
                        if (udao.SetUserLogIn(user) > 0)
                        {
                            user.IsLoggedIn = true;
                            BarcodeDetailsForm bdf = new BarcodeDetailsForm(user, this);
                            this.Hide();
                            bdf.Show();
                        }
                        else
                        {
                            MessageBox.Show("Multiple user log ins are not allowed", "Login error:");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Unable to log in using provided credentials", "Login error:");
                    }
                }
                else
                {
                    MessageBox.Show("User name and password is required", "Login");
                }
            }
            catch (SqlException se)
            {
                MessageBox.Show("Can not login due to unexpected sql exception" + se.Message, "Sql Exception:");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Can not login due to unexpected exception" + ex.Message, "Exception:");
            }
        }
 public BarcodeAdditionForm(BarcodeDetailsForm bf, User user) : this(bf)
 {
     this.LoggedInUser = user;
 }