Exemplo n.º 1
0
        private void insertCompanyData()
        {
            Persistence pers = new PersistenceImpl();

            var myconf = new MyConfiguration();

            myconf.currentBatch  = "2012-16";
            myconf.currentDegree = "B.TECH";

            var compList = new List <Object>();

            for (int i = 108; i < 109; i++)
            {
                var compObj = new Entity_Company();
                compObj.companyId   = i;
                compObj.companyName = "COMPANY" + i;

                var compDetail = new Entity_CompanyDetails();
                compDetail.DOR         = DateTime.Now.AddDays(20 + i);
                compDetail.host        = "ACET";
                compDetail.myConfigObj = myconf;
                compDetail.staffId     = 1;
                compDetail.status      = 1;
                compDetail.type        = 0;
                compDetail.companyObj  = compObj;

                compList.Add(compDetail);
            }

            pers.bulkInsert(compList);
        }
Exemplo n.º 2
0
 public Control_ViewCompany(ListControl_CompanyView compListControl, Entity_CompanyDetails compDetailsObj, Form_ViewCompanies viewCompany)
 {
     this.compListControl = compListControl;
     this.viewCompany     = viewCompany;
     this.compDetailObj   = compDetailsObj;
     InitializeComponent();
 }
Exemplo n.º 3
0
        public virtual bool addCompDetailsObj(Entity_CompanyDetails compDetailsObj)
        {
            compDetailsObj.companyObj = this;
            if (compDetailsObjList == null)
            {
                compDetailsObjList = new List <Entity_CompanyDetails>();
            }

            int size = this.compDetailsObjList.Count;

            compDetailsObjList.Add(compDetailsObj);

            return(size == compDetailsObjList.Count);
        }
Exemplo n.º 4
0
 private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (!Utility.isNetworkAvailable())
     {
         Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_NETWORK, 1, UiColors.MESSAGE_ERROR);
     }
     else
     {
         Entity_CompanyDetails compDetailObj   = listView1.SelectedItems[0].Tag as Entity_CompanyDetails;
         Control_ViewCompany   viewCompControl = new Control_ViewCompany(this, compDetailObj, viewCompany);
         viewCompany.panel_search.Hide();
         viewCompany.panel_main.Controls.Add(viewCompControl);
         this.Dispose();
     }
 }
Exemplo n.º 5
0
        public override bool Equals(Object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            if (this == obj)
            {
                return(true);
            }

            Entity_CompanyDetails compDetailsObj = obj as Entity_CompanyDetails;

            if (compDetailsObj.compDetailsId == 0)
            {
                return(this.myConfigObj.currentBatch.Equals(compDetailsObj.myConfigObj.currentBatch) &&
                       this.myConfigObj.currentDegree.Equals(compDetailsObj.myConfigObj.currentDegree));
            }

            return(this.compDetailsId.Equals(compDetailsObj.compDetailsId));
        }
Exemplo n.º 6
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            compManager = new CompanyManagerImpl();
            var company = compManager.getCompanyByName(textBox_companyName.Text.Trim());

            if (company == null)
            {
                company             = new Entity_Company();
                company.companyName = textBox_companyName.Text.Trim();
            }

            var dropdownMap = e.Argument as Dictionary <string, int>;

            var compDetails = new Entity_CompanyDetails();

            compDetails.type        = dropdownMap[EnumData.viewCompanyListHeadings.TYPE.ToString()];
            compDetails.host        = textBox_collegeName.Text.Trim();
            compDetails.DOR         = dateTime_dor.Value;
            compDetails.status      = dropdownMap[EnumData.viewCompanyListHeadings.STATUS.ToString()];
            compDetails.myConfigObj = Utility.getConfigObj();
            compDetails.staffId     = Common.loggedUser.staffId;

            if (company.addCompDetailsObj(compDetails))
            {
                e.Result = 0;
            }
            else
            {
                if (compManager.saveNewCompany(company))
                {
                    e.Result = 1;
                }
                else
                {
                    e.Result = 2;
                }
            }
        }