public void Company001PC(Companys company) { string userNo = (string)Session["User_No"]; if (userNo == null) { RedirectToAction("Login", "Auth"); } int companyNo = int.Parse(Request.Form["companyNo"]); using (var db = new MainDbContext()) { var originalSchedule = db.Companys.SingleOrDefault(r => r.COMPANY_NO == company.COMPANY_NO); if (originalSchedule != null) { try { originalSchedule.COMPANY_NM = company.COMPANY_NM; originalSchedule.COMPANY_PHONE = company.COMPANY_PHONE; db.SaveChanges(); } catch (Exception e) { throw; } } ViewBag.isJob = "Success"; } }
private Companys Fill(DataRow row) { Companys company = new Companys(); company.CompanyId = long.Parse(row["CompanyId"].ToString()); company.UserId = long.Parse(row["UserId"].ToString()); company.CNPJ = row["CNPJ"].ToString(); company.IM = row["IM"].ToString(); company.IE = row["IE"].ToString(); company.Name = row["Name"].ToString(); company.NameFantasy = row["NameFantasy"].ToString(); company.CEP = row["CEP"].ToString(); company.Street = row["Street"].ToString(); company.Neighborhood = row["Neighborhood"].ToString(); company.City = row["City"].ToString(); company.State = row["State"].ToString(); company.Telephone = row["Telephone"].ToString(); company.Email = row["Email"].ToString(); company.Logo = row["Logo"].ToString(); company.IRRF = decimal.Parse(row["IRRF"].ToString()); company.PIS = decimal.Parse(row["PIS"].ToString()); company.COFINS = decimal.Parse(row["COFINS"].ToString()); company.CSLL = decimal.Parse(row["CSLL"].ToString()); company.INSS = decimal.Parse(row["INSS"].ToString()); company.Active = bool.Parse(row["Active"].ToString()); company.DateInsert = row.Field <DateTime>("DateInsert").ToString("dd-MM-yyyy"); company.DateUpdate = row.Field <DateTime>("DateUpdate").ToString("dd-MM-yyyy"); return(company); }
protected void btnEdit_Click(object obj, EventArgs e) { if (c == null) { int id = int.Parse(Request.QueryString["ID"]); c = Companys.GetCompany(id); } c.CompanyName = txtCompanyName.Text.Trim(); c.CompanyRegion = int.Parse(hfRegionCode.Value); c.Phone = txtCompanyPhone.Text.Trim(); c.Fax = txtCompanyFax.Text.Trim(); c.Address = txtCompanyAddress.Text.Trim(); c.Zipcode = txtZipCode.Text.Trim(); c.Website = txtCompanyWebsite.Text.Trim(); c.Orgcode = txtOrgCode.Text.Trim(); c.Regcode = txtIcpCode.Text.Trim(); c.Remark = txtCompanyMemo.Text.Trim(); c.CompanyStatus = cslMain.SelectedValue; c.UpdateTime = DateTime.Now; c.UpdateUser = Profile.AccountInfo.UserID; bool result = Companys.UpdateCompany(c); if (result) { base.ExecuteJs("msg('操作成功,已成功修改公司信息!',true);", false); } else { base.ExecuteJs("msg('操作失败,无法修改公司信息!',false);", false); } }
public ActionResult Edit(Companys models) { bool status = false; if (ModelState.IsValid) { using (ZONYEntities db = new ZONYEntities()) { if (models.rowid > 0) { //Edit var Companys = db.Companys.Where(m => m.rowid == models.rowid).FirstOrDefault(); if (Companys != null) { Companys.mno = models.mno; Companys.mname = models.mname; Companys.remark = models.remark; } } else { //Save db.Companys.Add(models); } db.SaveChanges(); status = true; } } return(new JsonResult { Data = new { status = status } }); }
public ActionResult Create(Companys bt) { string error = string.Empty; if (ModelState.IsValid) { bool isSuccess = _serv.CreateCompanys(bt); TempData["AlertCSS"] = isSuccess ? "alert success" : "alert error"; if (!isSuccess) { ModelState.AddModelError("", error); } else { TempData["OutputMessage"] = "Record Successfully Created"; } if (ModelState.IsValid) { return(RedirectToAction("Index")); } } return(View()); }
private void Validate(Companys companys) { if (companys.UserId <= 0) { throw new InternalProgramException("Informe o usuário!"); } if (string.IsNullOrEmpty(Functions.RemoveCharSpecial(companys.CNPJ))) { throw new InternalProgramException("Informe o CNPJ!"); } if (Functions.RemoveCharSpecial(companys.CNPJ).Length != 14) { throw new InternalProgramException("O CNPJ deve ter 14 digitos!"); } if (string.IsNullOrEmpty(companys.Name)) { throw new InternalProgramException("Informe o nome da empresa!"); } if (string.IsNullOrEmpty(companys.NameFantasy)) { companys.NameFantasy = companys.Name; } if (string.IsNullOrEmpty(companys.CEP)) { throw new InternalProgramException("Informe o CEP!"); } if (companys.CEP.Length != 8) { throw new InternalProgramException("O cep deve conter 8 digitos!"); } if (string.IsNullOrEmpty(companys.Street)) { throw new InternalProgramException("Informe a rua!"); } if (string.IsNullOrEmpty(companys.Neighborhood)) { throw new InternalProgramException("Informe o bairro!"); } if (string.IsNullOrEmpty(companys.City)) { throw new InternalProgramException("Informe a cidade!"); } if (string.IsNullOrEmpty(companys.State)) { throw new InternalProgramException("Informe o estado!"); } }
public void Delegiraj(string clanId, string kompanijaId) { var idc = new List <int> { int.Parse(kompanijaId) }; Companys.DelegateTo(int.Parse(clanId), idc); Console.WriteLine(clanId, kompanijaId); }
public string GetContact(int id) { var cp = Companys.GetContactPerson(id); var c = CompanyModel.crateContactDTO(cp); var jsonSerialiser = new JavaScriptSerializer(); var json = jsonSerialiser.Serialize(c); return(json); }
public void egvCorps_RowDeleting(object sender, GridViewDeleteEventArgs e) { int id = (int)egvCorps.DataKeys[e.RowIndex].Value; Company c = Companys.GetCompany(id); c.CompanyStatus = CompanyStatus.Lockon; Companys.UpdateCompany(c); BindCorps(); }
public ActionResult AddContact(string name, string note, string email, string phone, string companyId) { int idc; int.TryParse(companyId, out idc); Companys.AddContactPerson(idc, email, name, phone, note); return(RedirectToAction("Index")); }
protected void Button13_Click(object sender, EventArgs e) { Company company = Companys.GetCompany("CompanyName"); if (company != null) { lblTip.Text = company.CreateTime.ToString(); } }
void BindCorps() { string name = Request.QueryString["CorpName"]; if (!string.IsNullOrEmpty(name)) { txtCompanyName.Text = name; } egvCorps.DataSource = Companys.GetCompanys(GetComStatus(), CompanyType.None, txtCompanyName.Text.Trim()); egvCorps.DataBind(); }
protected void Button12_Click(object sender, EventArgs e) { if (Companys.DeleteCompany("CompanyName")) { lblTip.Text = "Delete success"; } else { lblTip.Text = "Delete Fail"; } }
public IActionResult Delete(int id) { Companys cc = _db.Companys.Find(id); if (cc != null) { _db.Companys.Remove(cc); _db.SaveChanges(); } return(RedirectToAction("")); }
protected void egvPendings_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Literal lt1 = e.Row.Cells[0].FindControl("ltCompanyName") as Literal; Literal lt2 = e.Row.Cells[1].FindControl("ltCompanyType") as Literal; Pending p = e.Row.DataItem as Pending; Company c = Companys.GetCompany(p.CompanyID); lt1.Text = c.CompanyName; lt2.Text = GetCompanyType(c.CompanyType); } }
void BindSupply() { int id = int.Parse(Request.QueryString["ID"]); ProductSupply ps = ProductSupplyManager.GetProductSupply(id); Company c = Companys.GetCompany(ps.SupplierID); Area a = Areas.GetArea(c.CompanyRegion); string AN = "--"; if (a != null) { AN = a.RegionName; } ltCompanyName.Text = "<a class=\"navCompany\" href=\"javascript:{}\">[" + c.CompanyName + "]<div class=\"companyDetailsRemark_s\">" + "<div>区域:" + AN + "</div>" + "<div>组织机构代码:" + c.Orgcode + "</div>" + "<div>工商注册号码:" + c.Regcode + "</div>" + "<div>联系电话:" + c.Phone + "</div>" + "<div>公司传真:" + c.Fax + "</div>" + "<div>联系地址:" + c.Address + "</div>" + "<div>邮政编码:" + c.Zipcode + "</div>" + "<div>公司主页:" + c.Website + "</div>" + "</div></a>"; ltFaxRate.Text = ps.ApplyTaxRate.ToString("P2"); dsDeliverySpan.DateSpanValue = ps.DeliverySpan; ltCreateTime.Text = ps.CreateTime.ToShortDateString(); ltCreateUser.Text = Users.GetUser(ps.CreateUser).UserName; ltHasfeight.Text = (ps.IncludeFreight == FreightIncludeType.Include ? "是" : "<span class='needed'>否</span>"); ltIncludeTax.Text = (ps.IncludeTax == TaxIncludeType.Include ? "是" : "<span class='needed'>否</span>"); if (ps.SupplyRegion == null) { ltRegion.Text = "全国"; } else { AN = string.Empty; a = Areas.GetArea(ps.SupplyRegion.Value); if (a != null) { AN = a.RegionName; } ltRegion.Text = a.RegionName; } ltStartTime.Text = ps.QuoteFrom.ToShortDateString(); ltEndTime.Text = ps.QuoteEnd.ToShortDateString(); ltAmount.Text = (ps.QuoteMOQ == null ? "无要求" : ps.QuoteMOQ.Value.ToString()); ltPrice.Text = GlobalSettings.GetPrice(ps.QuotePrice); ltQuoteRenewal.Text = (ps.QuoteRenewal == 0 ? "无" : ps.QuoteRenewal + "月"); dsWS.DateSpanValue = ps.WarrantySpan; ltSupply.Text = (ps.SupplyStatus == ComponentStatus.Enabled ? "是" : "<span class='needed'>否</span>"); }
void BindCD() { User u = Profile.AccountInfo; if (u.UserType == UserType.InnerUser) { mbNC.ShowMsg("内部员工没有相关的公司信息,请选择其它信息进行查看!", System.Drawing.Color.Olive); pnlNormal.Visible = false; pnlManager.Visible = false; } else { if (u.IsManager == 1) { pnlManager.Visible = true; pnlNormal.Visible = false; } else { pnlManager.Visible = false; pnlNormal.Visible = true; } mbNC.HideMsg(); c = Companys.GetCompanyByUser(u.UserID); ltCompanyName.Text = c.CompanyName; ltName.Text = c.CompanyName; hfRegionCode.Value = c.CompanyRegion.ToString(); try { Area a = Areas.GetArea(c.CompanyRegion); txtRegion.Text = a.RegionName; ltArea.Text = a.RegionName; } catch { } txtCompanyPhone.Text = c.Phone; ltPhone.Text = c.Phone; txtCompanyFax.Text = c.Fax; ltFax.Text = c.Fax; txtCompanyAddress.Text = c.Address; ltAddress.Text = c.Address; txtZipCode.Text = c.Zipcode; ltZipcode.Text = c.Zipcode; txtCompanyWebsite.Text = c.Website; ltWebsite.Text = "<a href='" + c.Website + "' target='_blank' style='color:#0000ff' >" + c.Website + "</a>"; txtOrgCode.Text = c.Orgcode; ltOrgCode.Text = c.Orgcode; txtIcpCode.Text = c.Regcode; ltRegCode.Text = c.Regcode; txtCompanyMemo.Text = c.Remark; ltDescription.Text = c.Remark; } }
public ActionResult Edit(int id = 0) { using (ZONYEntities db = new ZONYEntities()) { if (id == 0) { Companys new_model = new Companys(); return(View(new_model)); } var models = db.Companys.Where(m => m.rowid == id).FirstOrDefault(); return(View(models)); } }
public ActionResult Company001PC(string companyNo) { string userNo = (string)Session["User_No"]; if (userNo == null) { RedirectToAction("Login", "Auth"); } var db = new MainDbContext(); Companys companys = db.Companys.Where(r => r.COMPANY_NO.ToString() == companyNo).Single(); return(View(companys)); }
string GetCompanyName(int comId) { Company c = Companys.GetCompany(comId); if (c == null) { return("--"); } else { return(c.CompanyName); } }
protected void Button11_Click(object sender, EventArgs e) { Company company = Companys.GetCompany("CompanyName"); company.Remark = DateTime.Now.ToString(); if (Companys.UpdateCompany(company)) { lblTip.Text = "Update Success"; } else { lblTip.Text = "Update Fail"; } }
public Companys Put(Companys companys) { try { Validate(companys); if (companys.CompanyId <= 0) { throw new Exception("Informe o código da empresa!"); } SQL.AppendLine(" Update Companys Set "); SQL.AppendLine(" UserId = " + companys.UserId + ","); SQL.AppendLine(" CNPJ = '" + Functions.RemoveCharSpecial(Functions.NoQuote(companys.CNPJ)) + "',"); SQL.AppendLine(" IM = " + (string.IsNullOrEmpty(companys.IM) ? "Null," : "'" + Functions.RemoveCharSpecial(Functions.NoQuote(companys.IM)) + "',")); SQL.AppendLine(" IE = " + (string.IsNullOrEmpty(companys.IE) ? "Null," : "'" + Functions.RemoveCharSpecial(Functions.NoQuote(companys.IE)) + "',")); SQL.AppendLine(" Name = '" + Functions.NoQuote(companys.Name) + "',"); SQL.AppendLine(" NameFantasy = '" + Functions.NoQuote(companys.NameFantasy) + "',"); SQL.AppendLine(" CEP = '" + Functions.RemoveCharSpecial(Functions.NoQuote(companys.CEP)) + "',"); SQL.AppendLine(" Street = '" + Functions.NoQuote(companys.Street) + "',"); SQL.AppendLine(" Neighborhood = '" + Functions.NoQuote(companys.Neighborhood) + "',"); SQL.AppendLine(" City = '" + Functions.NoQuote(companys.City) + "', "); SQL.AppendLine(" State = '" + Functions.NoQuote(companys.State) + "',"); SQL.AppendLine(" Telephone = " + (string.IsNullOrEmpty(companys.Telephone) ? "Null," : "'" + Functions.RemoveCharSpecial(Functions.NoQuote(companys.Telephone)) + "',")); SQL.AppendLine(" Email = " + (string.IsNullOrEmpty(companys.Email) ? "Null," : "'" + Functions.RemoveCharSpecialEmail(Functions.NoQuote(companys.Email)) + "',")); SQL.AppendLine(" Logo = '" + (companys.Logo == null ? string.Empty : Functions.NoQuote(companys.Logo)) + "',"); SQL.AppendLine(" IRRF = " + Functions.FormatNumber(companys.IRRF) + ","); SQL.AppendLine(" PIS = " + Functions.FormatNumber(companys.PIS) + ","); SQL.AppendLine(" COFINS = " + Functions.FormatNumber(companys.COFINS) + ","); SQL.AppendLine(" CSLL = " + Functions.FormatNumber(companys.CSLL) + ","); SQL.AppendLine(" INSS = " + Functions.FormatNumber(companys.INSS) + ","); SQL.AppendLine(" DateUpdate = GetDate() "); SQL.AppendLine(" Where Active = 1 "); SQL.AppendLine(" And CompanyId = " + companys.CompanyId); if (Functions.Conn.Update(SQL.ToString())) { TaxpayerActivitiesDomain taxpayerActivitiesDomain = new TaxpayerActivitiesDomain(); taxpayerActivitiesDomain.Reload(Homologation.CPF, Homologation.Password, Homologation.IM, int.Parse(Homologation.CityCod), companys.CompanyId); return(companys); } throw new InternalProgramException("Houve um problema ao atualizar a empresa."); } catch (Exception ex) { throw ex; } }
private void SendEmail(Takers Taker, Companys Company, Models.Models.NFeSStructure.NFeSProcessingResult.tbnfd NFeSAuthorized, Models.Models.NFeSStructure.NFeSPreview.util NFeSUrl) { Functions.Mail.SendEmail("*****@*****.**", Taker.Email, "NFSe N° " + NFeSAuthorized.nfdok.numeronfd + " emitida!", "A nota fiscal <b>N° " + NFeSAuthorized.nfdok.numeronfd + "</b> " + "foi emitida pela empresa <b>" + Company.Name.ToUpper() + "</b> portadora do CNPJ <b>" + Company.CNPJ + "</b>,<br/>" + "em favor de sua empresa/pessoa <b>" + Taker.Name.ToUpper() + "</b> portadora do CNPJ/CPF <b>" + Taker.CPF_CNPJ + "</b><br/>" + "no dia " + Functions.DateTimeBr().ToString("dd/MM/yyyy HH:mm") + " com o <b>Valor Total de R$ " + Functions.FormatNumber(decimal.Parse(NFeSAuthorized.nfdok.NewDataSet.NOTA_FISCAL.ValorTotalNota.Replace(".", ","))) + "</b>.<br/><br/>" + "<b>A nota fiscal pode ser consultada em:</b> " + NFeSUrl.urlNfd, "NFSe Fácil - Emp: " + Company.Name.ToUpper()); }
static void Main(string[] args) { Companys company = new Companys(1, "UAB Keldera", false, new List <string> { "+37064621141", "+3705562456" }); Console.WriteLine("ID: {0} \nImones pavadinimas: {1}, \nTipas:{2}, \nKontaktai: {3}", company.ID, company.Name, company.NeKomercinesPaskirtiesImone, company.phoneNumbers); foreach (var phone in company.phoneNumbers) { Console.WriteLine("{0}", phone); Console.ReadLine(); } }
public static void UpdateCompany(string company, string street, int streetN, int provinceId, string city, int postalCode, long phoneN, long cuitN) { using (SuuxEntities ent = new SuuxEntities()) { Companys c = ent.Companys.First(); c.company = company.ToUpper(); c.street = street.ToUpper(); c.street_n = streetN; c.province_id = provinceId; c.city = city.ToUpper(); c.postal_code = postalCode; c.phone_n = phoneN; c.cuit_n = cuitN; ent.SaveChanges(); } }
protected void Button10_Click(object sender, EventArgs e) { Company company = new Company(); company.CompanyName = "CompanyName"; company.CompanyType = CompanyType.Agent; company.CompanyStatus = CompanyStatus.Authenticated; if (Companys.Create(company) == CreateCompanyStatus.Success) { lblTip.Text = "Create Success:CompanyID =" + company.CompanyID; } else { lblTip.Text = "Create Fail"; } }
private async void CallCompanys() { var list = await Admin.apiService.GetAllCompanys(); Companys.Clear(); foreach (var item in list) { Companys.Add(new CompanyViewModel() { Title = item.Title, Description = item.Description, Address = item.Address, FechaCreacion = item.FechaCreacion, BrowseCommand = new Command <CompanyViewModel>(BrowseClient) }); } }
protected void saveButton_Click(object sender, EventArgs e) { try { Companys aCompanys = new Companys(); aCompanys.CompanyName = nameTextBox.Text; Literal1.Text = aCompanyManager.Save(aCompanys); nameTextBox.Text = ""; List <Companys> aCompanies = aCompanyManager.GetAllCompany(); companyGridView.DataSource = aCompanies; companyGridView.DataBind(); } catch (Exception ex1) { Literal1.Text = ex1.Message; } }
public ActionResult Post([FromBody] Companys companys) { try { var companyReturn = _companyRepository.Obtain( companys.Name, companys.Admission, companys.Function, companys.Activities); if (companyReturn != null) { return(BadRequest("Empresa já cadastrada")); } _companyRepository.Insert(companys); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }
protected void btnSave_Click(object sender, EventArgs e) { User u = Profile.AccountInfo; if (c == null) { c = Companys.GetCompanyByUser(u.UserID); } c.CompanyRegion = int.Parse(hfRegionCode.Value); c.Phone = txtCompanyPhone.Text.Trim(); c.Fax = txtCompanyFax.Text.Trim(); c.Address = txtCompanyAddress.Text.Trim(); c.Zipcode = txtZipCode.Text.Trim(); c.Website = txtCompanyWebsite.Text.Trim(); c.Orgcode = txtOrgCode.Text.Trim(); c.Regcode = txtIcpCode.Text.Trim(); c.Remark = txtCompanyMemo.Text.Trim(); c.UpdateTime = DateTime.Now; c.UpdateUser = Profile.AccountInfo.UserID; Companys.UpdateCompany(c); BindCD(); }