Exemplo n.º 1
0
 //
 public void GetHashTableModuleList()
 {
     objBLFD.HtModuleList.Clear();
     if (objBLFD.HTMAIN.Contains("module_cd") && objBLFD.HTMAIN["module_cd"] != null && objBLFD.HTMAIN["module_cd"].ToString() != "")
     {
         string[] str        = objBLFD.HTMAIN["module_cd"].ToString().Split(new string[] { "+$IPTLM$+" }, StringSplitOptions.RemoveEmptyEntries);
         string[] strDecrypt = new string[str.Length];
         int      i          = 0;
         if (str.Length != 0)
         {
             foreach (string s in str)
             {
                 strDecrypt[i] = VALIDATIONLAYER.Decrypt(s);
                 i++;
             }
             foreach (string st in strDecrypt)
             {
                 if (objBLFD.HtModuleList != null && !objBLFD.HtModuleList.Contains(st))
                 {
                     objBLFD.HtModuleList[st] = "1";
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        private void frmLogin_Load(object sender, EventArgs e)
        {
            if (flg_close == 1)
            {
                //this.Close();
                //timer1.Enabled = false;
                //backgroundWorker1.CancelAsync();
            }
            IPHostEntry host;

            host = Dns.GetHostEntry(Dns.GetHostName());
            foreach (IPAddress ip in host.AddressList)
            {
                if (ip.AddressFamily == AddressFamily.InterNetwork)
                {
                    localIP = ip.ToString();
                }
            }
            objIni.SetKeyFieldValue("SQL", "initial catalog", "InodeMFG");
            #region 2.0
            dset = objVALIDATION.Get_Company_Details("0");
            if (dset != null && dset.Tables.Count != 0 && dset.Tables[0].Rows.Count != 0)
            {
                if (File.Exists(dset.Tables[0].Rows[0]["logo"].ToString()))
                {
                    int _lastIndex = dset.Tables[0].Rows[0]["logo"].ToString().LastIndexOf('\\');
                    if (dset.Tables[0].Rows[0]["logo"].ToString().Substring(_lastIndex).ToString() != "\\window_add.png")
                    {
                        pictureBox2.Image = Image.FromFile(dset.Tables[0].Rows[0]["logo"].ToString());
                    }
                }

                objBLMain.No_of_users = VALIDATIONLAYER.Decrypt(objIniKey.GetKeyFieldValue("KEYTABLE", "key_field"));
                objBLMain.Local_ip = localIP;
                cmbfin_yr.DataSource = objVALIDATION.GETFIN_YEAR().Tables[0];
                cmbfin_yr.DisplayMember = "fin_yr";
                cmbfin_yr.ValueMember = "fin_yr";
                cmbfin_yr.Update();
                Bind_Comp_Value();

                this.BackColor = Color.White;
                this.ForeColor = Color.Black;
                ucToolBar1.Width = this.Width; this.ucToolBar1.Maximize = false;
                ucToolBar1.UCbackcolor = Color.SlateGray;
                ucToolBar1.Width1 = this.Width;
                ucToolBar1.Titlebar = "iMANTRA Login";
            }
            else
            {
                AutoClosingMessageBox.Show("Sorry!! Organization is not Created.", "Error");
                this.Close();
            }
            #endregion 2.0
        }
Exemplo n.º 3
0
        private void frmGenerateXML_Load(object sender, EventArgs e)
        {
            this.BackColor                     = Color.White;
            this.ForeColor                     = Color.Black; ucToolBar1.Width = this.Width; this.ucToolBar1.Maximize = false;
            ucToolBar1.Width1                  = this.Width;
            ucToolBar1.Titlebar                = "License Generation";
            ucToolBar1.UCbackcolor             = Color.Firebrick;
            objControlSetMaster.Back_color     = "White";
            objControlSetMaster.Font_color     = "Black";
            objControlSetMaster.Uc_color       = "Firebrick";
            objControlSetMaster.Tab_back_color = "White";
            objControlSetMaster.Tab_font_color = "Black";

            IPHostEntry host;
            string      localIP = "?";

            host = Dns.GetHostEntry(Dns.GetHostName());
            foreach (IPAddress ip in host.AddressList)
            {
                if (ip.AddressFamily == AddressFamily.InterNetwork)
                {
                    localIP = ip.ToString();
                }
            }

            ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_Processor");

            foreach (ManagementObject share in searcher.Get())
            {
                txtMotherBoardId.Text = share.Properties["ProcessorId"].Value.ToString();
                txtMacId.Text         = VALIDATIONLAYER.identifier("Win32_NetworkAdapterConfiguration", "MACAddress", "IPEnabled");
                txtSystemNm.Text      = share.Properties["SystemName"].Value.ToString();
                txtSystemIp.Text      = localIP;
            }
            BindControls();
        }
Exemplo n.º 4
0
        private bool Click_Save()
        {
            objIni.SetKeyFieldValue("SQL", "initial catalog", "InodeMFG");
            if (cmbTheme.SelectedValue != null && cmbTheme.SelectedValue.ToString() == "")
            {
                AutoClosingMessageBox.Show("Please Enter Theme Name", "Validation", 3000); return(false);
            }
            if (objBASEFILEDS.Tran_mode != "view_mode" && txtEid.Text != "")
            {
                Regex emailPattern = new Regex(@"^[a-zA-Z][\w\.-]{2,28}[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$");
                if (!emailPattern.IsMatch(txtEid.Text))
                {
                    AutoClosingMessageBox.Show("Please provide valid E-mail ID", "Validation", 3000);
                    return(false);
                }
            }
            if (objBASEFILEDS.Tran_mode != "view_mode" && txtUser.Text != "")
            {
                Regex mobilePattern = new Regex(@"[a-zA-Z]+$");
                if (!mobilePattern.IsMatch(txtUser.Text))
                {
                    AutoClosingMessageBox.Show("Please enter Alphabets", "Validation", 3000);
                    return(false);
                }
            }
            if (objBASEFILEDS.Tran_mode != "view_mode" && txtConct.Text != "")
            {
                Regex contactpattern = new Regex(@"^(?:[0-9]+(?:-[0-9])?)*$");

                if (!contactpattern.IsMatch(txtConct.Text))
                {
                    AutoClosingMessageBox.Show("Please enter valid number", "Validation", 3000);
                    return(false);
                }
            }
            if (objBASEFILEDS.Tran_mode != "view_mode" && txtMob.Text != "")
            {
                Regex mobilePattern = new Regex(@"[-+]?[0-9]?[0-9]?\d{10}$");
                if (!mobilePattern.IsMatch(txtMob.Text))
                {
                    AutoClosingMessageBox.Show("Please enter a valid Mobile number", "Validation", 3000);
                    return(false);
                }
            }
            if (txtUser.Text != "")
            {
                if (txtPwd.Text != "" && txtRpwd.Text != "")
                {
                    if (txtPwd.Text == txtRpwd.Text)
                    {
                        objBASEFILEDS.HTMAIN["userid"]      = objBASEFILEDS.Tran_id;
                        objBASEFILEDS.HTMAIN["user_nm"]     = txtUser.Text;
                        objBASEFILEDS.HTMAIN["pwd"]         = txtPwd.Text;
                        objBASEFILEDS.HTMAIN["r_pwd"]       = txtRpwd.Text;
                        objBASEFILEDS.HTMAIN["status_nm"]   = cmbStat.Text;
                        objBASEFILEDS.HTMAIN["email"]       = txtEid.Text;
                        objBASEFILEDS.HTMAIN["designation"] = txtDesgn.Text;
                        objBASEFILEDS.HTMAIN["mobile"]      = txtMob.Text;
                        objBASEFILEDS.HTMAIN["phone"]       = txtConct.Text;
                        objBASEFILEDS.HTMAIN["theme_nm"]    = cmbTheme.Text;
                        objBASEFILEDS.HTMAIN["compid"]      = objBASEFILEDS.ObjCompany.Compid;
                        objBASEFILEDS.HTMAIN["deactfrm"]    = dtpDeact.DtValue.ToString("yyyy/MM/dd");
                        if (objBASEFILEDS.Tran_mode == "add_mode")
                        {
                            objBASEFILEDS.HTMAIN["sec_code"] = VALIDATIONLAYER.Encrypt(txtUser.Text);
                        }
                        else
                        {
                            objBASEFILEDS.HTMAIN["sec_code"] = txtCode.Text;
                        }
                        DataSet ds = objDL_ADAPTER.dsquery("select comp_nm, fin_yr from org_mast where compid='" + objBASEFILEDS.ObjCompany.Compid + "'");
                        if (ds != null && ds.Tables.Count != 0 && ds.Tables[0].Rows.Count != 0)
                        {
                            objBASEFILEDS.HTMAIN["comp_nm"] = ds.Tables[0].Rows[0]["comp_nm"].ToString();
                            objBASEFILEDS.HTMAIN["fin_yr"]  = ds.Tables[0].Rows[0]["fin_yr"].ToString();
                        }
                        return(true);
                    }
                    else
                    {
                        AutoClosingMessageBox.Show("passwords don't match", "Validation", 3000);
                        txtRpwd.Validating -= new CancelEventHandler(txtRpwd_Validating);
                        txtRpwd.Clear();
                        return(false);
                    }
                }
                else
                {
                    AutoClosingMessageBox.Show("Please Enter Password", "Validation", 3000);
                    return(false);
                }
            }
            else
            {
                AutoClosingMessageBox.Show("Enter User Name", "Validation", 3000);
                return(false);
            }
        }
Exemplo n.º 5
0
        private void btnDone_Click(object sender, EventArgs e)
        {
            if (dsest != null && dsest.Tables.Count != 0 && dsest.Tables[0].Rows.Count != 0)
            {
                XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;
                using (XmlWriter writer = XmlWriter.Create(cmbOrgNm.Text.Replace('.', ' ') + "-" + txtMotherBoardId.Text + ".xml", settings))
                {
                    writer.WriteStartDocument();
                    writer.WriteStartElement("Orgnization");

                    foreach (DataRow row in dsest.Tables[0].Rows)
                    {
                        // writer.WriteStartElement("Company");
                        writer.WriteElementString("comp_id", row["CompId"].ToString());
                        writer.WriteElementString("Comp_nm", row["Comp_nm"].ToString());
                        writer.WriteElementString("Add1", row["Add1"] != null ? row["Add1"].ToString() : "");
                        writer.WriteElementString("Add2", row["Add2"] != null ? row["Add2"].ToString() : "");
                        writer.WriteElementString("Add3", row["Add3"] != null ? row["Add3"].ToString() : "");
                        writer.WriteElementString("area_nm", row["area_nm"] != null ? row["area_nm"].ToString() : "");
                        writer.WriteElementString("zone_nm", row["zone_nm"] != null ? row["zone_nm"].ToString() : "");
                        writer.WriteElementString("city_nm", row["city_nm"] != null ? row["city_nm"].ToString() : "");
                        writer.WriteElementString("zip", row["zip"] != null ? row["zip"].ToString() : "");
                        writer.WriteElementString("state_id", row["state_id"] != null ? row["state_id"].ToString() : "100");
                        writer.WriteElementString("country_id", row["country_id"] != null ? row["country_id"].ToString() : "13");
                        writer.WriteElementString("state_nm", row["state_nm"] != null ? row["state_nm"].ToString() : "");
                        writer.WriteElementString("country_nm", row["country_nm"] != null ? row["country_nm"].ToString() : "");
                        writer.WriteElementString("Email", row["Email"] != null ? row["Email"].ToString() : "");
                        writer.WriteElementString("ecc_no", row["ecc_no"] != null ? row["ecc_no"].ToString() : "");
                        writer.WriteElementString("Fin_yr", row["Fin_yr"] != null ? row["Fin_yr"].ToString() : "");
                        writer.WriteElementString("module_cd", row["module_cd"] != null ? row["module_cd"].ToString() : "");
                        string   module_nm  = "";
                        string[] str        = row["module_cd"].ToString().Split(new string[] { "+$IPTLM$+" }, StringSplitOptions.RemoveEmptyEntries);
                        string[] strDecrypt = new string[str.Length];
                        int      i          = 0;
                        if (str.Length != 0)
                        {
                            foreach (string s in str)
                            {
                                strDecrypt[i] = VALIDATIONLAYER.Decrypt(s);
                                i++;
                            }
                            foreach (string st in strDecrypt)
                            {
                                if (module_nm == "")
                                {
                                    module_nm = st;
                                }
                                else
                                {
                                    module_nm = module_nm + "," + st;
                                }
                            }
                        }
                        writer.WriteElementString("module_nm", module_nm);
                        writer.WriteElementString("comp_type", cmbOrgType.Text != null ? cmbOrgType.Text : "MAIN-COMPANY");
                        writer.WriteElementString("noofusers", txtNoOfUsers.Text != "" ? txtNoOfUsers.Text : "1");
                        writer.WriteElementString("product", "iMANTRA");
                        writer.WriteElementString("prod_version", "5.0.0");
                        writer.WriteElementString("mac_id", txtMacId.Text != "" ? txtMacId.Text : "1");
                        writer.WriteElementString("server_ip", txtSystemIp.Text != "" ? txtSystemIp.Text : "");
                        writer.WriteElementString("server_nm", txtSystemNm.Text != "" ? txtSystemNm.Text : "");
                        writer.WriteElementString("motherboard_id", txtMotherBoardId.Text != "" ? txtMotherBoardId.Text : "");

                        //writer.WriteEndElement();
                    }
                    writer.WriteEndElement();
                    writer.WriteEndDocument();
                }
            }
            AutoClosingMessageBox.Show("Generated License successfully", "Generate License");
            this.Close();
        }
Exemplo n.º 6
0
 private void frmORGModule_Load(object sender, EventArgs e)
 {
     foreach (Control con1 in this.Controls)
     {
         if (!(con1 is UCToolBar))
         {
             foreach (Control c in con1.Controls)
             {
                 if (objBSFD.Tran_mode != "add_mode")
                 {
                     if (!(c is Label))
                     {
                         c.Enabled = false;
                     }
                 }
                 else
                 {
                     c.Enabled = true;
                 }
             }
         }
     }
     if (objBSFD.HTMAIN.Contains("module_cd") && objBSFD.HTMAIN["module_cd"] != null && objBSFD.HTMAIN["module_cd"].ToString() != "")
     {
         string[] str        = objBSFD.HTMAIN["module_cd"].ToString().Split(new string[] { "+$IPTLM$+" }, StringSplitOptions.RemoveEmptyEntries);
         string[] strDecrypt = new string[str.Length];
         int      i          = 0;
         if (str.Length != 0)
         {
             foreach (string s in str)
             {
                 strDecrypt[i] = VALIDATIONLAYER.Decrypt(s);
                 i++;
             }
             foreach (string st in strDecrypt)
             {
                 if (st == "BSIC")
                 {
                     rbtnBasic.Checked = true;
                 }
                 if (st == "BMFG")
                 {
                     rbtnExciseMfg.Checked = true;
                 }
                 if (st == "BTRD")
                 {
                     rbtnExciseTrd.Checked = true;
                 }
                 if (st == "MKTG")
                 {
                     chkMarketing.Checked = true;
                 }
                 if (st == "PRCM")
                 {
                     chkProcurement.Checked = true;
                 }
                 if (st == "INVT")
                 {
                     chkInventory.Checked = true;
                 }
                 if (st == "PROD")
                 {
                     chkProduction.Checked = true;
                 }
                 if (st == "PLAN")
                 {
                     chkPlanning.Checked = true;
                 }
                 if (st == "QUAL")
                 {
                     chkQuality.Checked = true;
                 }
                 if (st == "JOBW")
                 {
                     chkJobWork.Checked = true;
                 }
                 if (st == "WRHS")
                 {
                     chkWarehouse.Checked = true;
                 }
                 if (st == "GRAP")
                 {
                     chkGraphics.Checked = true;
                 }
             }
         }
     }
     else
     {
         rbtnBasic.Checked = true;
     }
     AddThemesToTitleBar((Form)this, ucToolBar1, objBSFD, "CustomMaster");
     ucToolBar1.Titlebar = "Module Selection";
 }
Exemplo n.º 7
0
        private void btnDone_Click(object sender, EventArgs e)
        {
            bool flg = true;

            if (rbtnBasic.Checked)
            {
                if (chkInventory.Checked || chkProduction.Checked || chkPlanning.Checked)
                {
                    MessageBox.Show("Sorry! checking Inventory,Production & Planning is not allowed.");
                    flg = false;
                }
            }
            else if (rbtnExciseMfg.Checked)
            {
                if (chkJobWork.Checked)
                {
                    MessageBox.Show("Sorry! checking Job Work is not allowed.");
                    flg = false;
                }
                else
                {
                    if (!((chkInventory.Checked && chkProduction.Checked) || (!chkInventory.Checked && !chkProduction.Checked)))
                    {
                        MessageBox.Show("Sorry! checking either Inventory or Production is not allowed.");
                        flg = false;
                    }
                    if (chkPlanning.Checked)
                    {
                        if (!chkProduction.Checked)
                        {
                            MessageBox.Show("Sorry! checking Planning is not possible untill Production is not checked.");
                            flg = false;
                        }
                    }
                }
            }
            else
            {
                if (chkInventory.Checked || chkProduction.Checked || chkPlanning.Checked || chkJobWork.Checked)
                {
                    MessageBox.Show("Sorry! checking Inventory,Production,Planning & Job Work is not allowed.");
                    flg = false;
                }
            }
            if (flg)
            {
                strModuleCode = "";
                if (rbtnBasic.Checked)
                {
                    strModuleCode = strModuleCode != "" ? strModuleCode + "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("BSIC") : VALIDATIONLAYER.Encrypt("BSIC");
                }
                else if (rbtnExciseMfg.Checked)
                {
                    strModuleCode = strModuleCode != "" ? strModuleCode + "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("BMFG") : VALIDATIONLAYER.Encrypt("BMFG");
                }
                else
                {
                    strModuleCode = strModuleCode != "" ? strModuleCode + "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("BTRD") : VALIDATIONLAYER.Encrypt("BTRD");
                }
                if (chkMarketing.Checked)
                {
                    strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("MKTG");
                }
                if (chkProcurement.Checked)
                {
                    strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("PRCM");
                }
                if (chkInventory.Checked)
                {
                    strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("INVT");
                }
                if (chkProduction.Checked)
                {
                    strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("PROD");
                }
                if (chkPlanning.Checked)
                {
                    strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("PLAN");
                }
                if (chkQuality.Checked)
                {
                    strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("QUAL");
                }
                if (chkJobWork.Checked)
                {
                    strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("JOBW");
                }
                if (chkWarehouse.Checked)
                {
                    strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("WRHS");
                }
                if (chkGraphics.Checked)
                {
                    strModuleCode += "+$IPTLM$+" + VALIDATIONLAYER.Encrypt("GRAP");
                }
                objBSFD.HTMAIN["module_cd"] = strModuleCode;
                this.Close();
            }
        }
Exemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                //sharanamma on 05.08.13 reason:user restriction
                //begin
                bool flgLoginContinue = true;
                if (cmbComp_nm.SelectedValue != null)
                {
                    #region
                    //string strCon = "";
                    //int days = 1;
                    //string strMotherBoardId = "";
                    //ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_Processor");
                    //foreach (ManagementObject share in searcher.Get())
                    //{
                    //    strMotherBoardId = share.Properties["ProcessorId"].Value.ToString();
                    //    system_nm = share.Properties["SystemName"].Value.ToString();
                    //}
                    //string[] str = new string[] { "I", "T", "P", "L" };
                    //int j = 0;
                    //foreach (string st in str)
                    //{
                    //    j += 1;
                    //    strMotherBoardId = strMotherBoardId.Insert(j * 4 + (j - 1), st);
                    //}
                    //if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + strMotherBoardId + ".xml"))
                    //{
                    //    DataSet dsCompDet = objVALIDATION.Get_Company_Details(cmbComp_nm.SelectedValue.ToString());
                    //    if (dsCompDet != null && dsCompDet.Tables.Count != 0 && dsCompDet.Tables[0].Rows.Count != 0)
                    //    {
                    //        XmlDocument xmlDoc = new XmlDocument();
                    //        xmlDoc.Load(strMotherBoardId + ".xml");

                    //        bool flgIn = false;
                    //        string strKey = "";
                    //        foreach (DataRow row in dsCompDet.Tables[0].Rows)
                    //        {
                    //            strKey = "";
                    //            XmlNodeList node = xmlDoc.SelectNodes("Orgnization");

                    //            foreach (XmlNode root in node)
                    //            {
                    //                if (root.HasChildNodes)
                    //                {
                    //                    for (int i = 0; i < root.ChildNodes.Count; i++)
                    //                    {
                    //                        if (root.ChildNodes[i].Name == "key")
                    //                        {
                    //                            strKey = root.ChildNodes[i].InnerText;
                    //                        }
                    //                    }
                    //                }
                    //            }
                    //            if (strKey != "")
                    //            {
                    //                ManagementObjectSearcher searcher1 = new ManagementObjectSearcher("select * from Win32_Processor");
                    //                foreach (ManagementObject share in searcher1.Get())
                    //                {
                    //                    mother_board_id = share.Properties["ProcessorId"].Value.ToString();
                    //                    mac_id = VALIDATIONLAYER.identifier("Win32_NetworkAdapterConfiguration", "MACAddress", "IPEnabled");
                    //                    system_nm = share.Properties["SystemName"].Value.ToString();
                    //                }
                    //                string[] strArrayKeys = strKey.Split(new string[] { "+$IT-PL$+" }, StringSplitOptions.RemoveEmptyEntries);
                    //                if (strArrayKeys != null && strArrayKeys.Length != 0 && strArrayKeys.Length == 8)
                    //                {
                    //                    flgIn = true;
                    //                    foreach (DataColumn col in dsCompDet.Tables[0].Columns)
                    //                    {
                    //                        switch (col.ColumnName.ToLower())
                    //                        {
                    //                            case "comp_nm": flgIn = strArrayKeys[0] == VALIDATIONLAYER.Encrypt(row[col.ColumnName].ToString()) ? true : false;
                    //                                break;
                    //                            case "module_cd": flgIn = strArrayKeys[2] == row[col.ColumnName].ToString() ? true : false;
                    //                                break;
                    //                        }
                    //                        if (!flgIn)
                    //                        {
                    //                            break;
                    //                        }
                    //                    }
                    //                    if (flgIn)
                    //                    {
                    //                        if (strArrayKeys[4] != VALIDATIONLAYER.Encrypt(mac_id))
                    //                        {
                    //                            flgIn = false;
                    //                        }
                    //                        if (flgIn && strArrayKeys[5] != VALIDATIONLAYER.Encrypt(mother_board_id))
                    //                        {
                    //                            flgIn = false;
                    //                        }
                    //                        if (flgIn)
                    //                        {
                    //                            license_type = VALIDATIONLAYER.Decrypt(strArrayKeys[6]);
                    //                            objBLMain.License_type = license_type;
                    //                            if (license_type == "CUSTOMER LICENSE")
                    //                            {
                    //                                strCon = DateTime.Now.ToString();
                    //                            }
                    //                            else
                    //                            {
                    //                                strCon = VALIDATIONLAYER.Decrypt(strArrayKeys[7]);
                    //                                days = 30;
                    //                            }
                    //                        }
                    //                    }
                    //                }
                    //                else
                    //                {
                    //                    flgIn = false;
                    //                }
                    //            }
                    //        }
                    //        if (flgIn)
                    //        {
                    //            if ((DateTime.Now - Convert.ToDateTime(strCon != "" ? strCon : "01/01/1900")).Days <= days)
                    //            {
                    #endregion
                    if (objVALIDATION.Find_Login_User(txtUserNm.Text.Replace("'", "''"), txtPassword.Text, cmbfin_yr.SelectedValue.ToString(), cmbComp_nm.SelectedValue.ToString().Replace("'", "''")))
                    {
                        #region
                        objBLMain.CurUser = txtUserNm.Text;
                        #endregion
                        //user logg. Sharanamma on 05.04.14
                        objFLGENINV.InsertUpdateAndDelete(objBLMain.CurUser, "1", objBLMain.Local_ip);//update datetime

                        if (flgLoginContinue)
                        {
                            DataSet ds = objDL_ADAPTER.dsquery("select lm.*,rm.role_nm from login_mast lm inner join roles_mapping rm on lm.user_nm=rm.user_nm and lm.compid=rm.compid and lm.userid=rm.userid where lm.USER_NM='" + txtUserNm.Text.Replace("'", "''") + "'");
                            if (ds != null && ds.Tables.Count != 0 && ds.Tables[0].Rows.Count != 0)
                            {
                                string user;
                                user = VALIDATIONLAYER.Decrypt(ds.Tables[0].Rows[0]["SEC_CODE"].ToString());
                                objBLMain.User_theme = ds.Tables[0].Rows[0]["theme_nm"] != null ? ds.Tables[0].Rows[0]["theme_nm"].ToString() : "";
                                objBLMain.Role_nm = ds.Tables[0].Rows[0]["role_nm"] != null ? ds.Tables[0].Rows[0]["role_nm"].ToString() : "";
                                if (user == txtUserNm.Text)
                                {
                                    processLogin();
                                }
                                else
                                {
                                    AutoClosingMessageBox.Show("Unauthorised attempt to login", "Error");
                                    flgLoginContinue = false;
                                    txtUserNm.Clear();
                                    txtPassword.Clear();
                                }
                            }
                        }
                    }
                    else
                    {
                        AutoClosingMessageBox.Show("Please enter valid user/password", "Error");
                        txtUserNm.Text = "";
                        txtPassword.Text = "";
                        txtUserNm.Focus();
                    }
                    #region
                    //    }
                    //    else
                    //    {
                    //        AutoClosingMessageBox.Show("Sorry!! " + license_type + " Expired. Please Contact Inode Technologies Pvt. Ltd.", "License");
                    //        this.Close();
                    //    }
                    //}
                    //else
                    //{
                    //    AutoClosingMessageBox.Show("Sorry!! Invalid License. Please Contact Inode Technologies Pvt. Ltd.", "License");
                    //    this.Close();
                    //}
                    //    }
                    //}
                    //else
                    //{
                    //    this.Hide();
                    //    frmGenerateXML objGenerateXML = new frmGenerateXML();
                    //    objGenerateXML.ShowDialog();
                    //    this.Close();
                    //}
                    #endregion
                }
            }
            catch (Exception ex)
            {
                AutoClosingMessageBox.Show(ex.Message, "Exception");
            }
        }